How to create new subsite while adding new item to the list by using javascript?

hi,
I hav a task ie, when I add item to the list then subsite will create with that list item title and description . So By using javascript, I have to create subsite while adding new item to the list.
Help me to solve this.
Thank you, 

Is your item getting added through Javascript client object model ? If yes, you can write in the success delegate of your list creation method the logic to create the subsite.
function CreateListItem()
var clientContext = new SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle('List Name');
var itemCreateInfo = new SP.ListItemCreationInformation();
this.oListItem = oList.addItem(itemCreateInfo);
oListItem.set_item('Title', 'My New Item!');
oListItem.set_item('Body', 'Hello World!');
oListItem.update();
clientContext.load(oListItem);
clientContext.executeQueryAsync(Function.createDelegate(this, this.CreateListItemOnSuccess), Function.createDelegate(this, this.onQueryFailed));
function CreateListItemOnSuccess() {
var subsiteTitle = oListItem.get_item('Title');
//Logic to create a subsite
function onQueryFailed(sender, args) {
I have added a sample flow for the above scenario. Have a look at the following lnk for how you can craete a subsite using ecmascript.
http://ravisoftltd.wordpress.com/2013/03/06/sharepoint-2010-create-site-with-ecma-script-with/
Geetanjali Arora | My blogs |

Similar Messages

  • How to create a background image for each item in a List object

    Hello.
    I am trying to create a background image that displays whenever a user posts something to a list.  For example when a user posts text it would appear in a list.  The new item in the list would contain a specific background image with the users text appearing on top of the background image.  I do not want a background image for the entire list, rather each item within the list.
    I am not sure how clear this is so I added an image below.  When a user enters text in and clicks the "post-it" button their text would appear below with the sticky note background. 
    I am not sure which list type would be best for this problem or how to create insert the image, so I am open to suggestions. 
    Thank you for your help.  Any advice or guidance will be greatly appreciated!

    Hi
    the easiest way would be with itemRenderer.
    You have to do two things:
    1. In your list declaration use a item renderer: <mx:List itemRenderer="myRenderer"/>
    2. create a flex component myRenderer that will be the single item. This can be a canvas with a background image and a text field on it.
    When you add a new item to the list, a new myRenderer item will be created and the data property will be passed to it. So you have to put "data" in your textField.
    If you need more help try looking at Tour de Flex samples, they're pretty easy.
    Andrei

  • How to create a report  based on selected item from Select list?

    Hi,
    I have created a tables_LOV based on:
    select table_name d, table_name r from user_tab_cols
    where column_name like '%_type%'
    Then I created a page item ListOfTables,  Display as select list and pointing to tables_LOV.
    I run the page, and i can select the table i want from the drop down list.
    How to create a report  based on the selected item? (ex: select * from selected_table)
    many thanks in advance
    Salah

    Hi Salah,
    Allright, have a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report
    I think that simulates what you're trying to accomplish. I've set up the simplest method I could think of.
    The report is based on an apex collection. If you are not familiar with that, you should study the documentation: APEX_COLLECTION
    To recreate my example you should:
    1) create an (interactive) report on your collection
    SELECT *
       FROM APEX_collections
    WHERE collection_name = 'MY_COLLECTION'
    2) create a page_item select list for the tables you want to display (in my case this is called "P38_TABLES" )
    3) create a dynamic action that triggers on change of your select list page_item. The dynamic action must be a PL/SQL procedure perfoming the following code:
    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
    end;
    Make sure you add your page_item to the "Page Items to Submit" section.
    4) Add an extra true action that does a refresh of the report region.
    Here are two pictures describing the da:
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA1.png
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA2.png
    Good luck and regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • While adding new fonts, somehow dumped necessary fonts from OS 10.6 library. now have only blank menus, dialog boxes, even apple support site. How to fix?

    Imac Snow Leopard .....While adding new fonts, somehow dumped necessary fonts from OS 10.6 library. now have only blank menus, dialog boxes, even apple support site. How to fix?

    Thanks again baltwo,
    Thank you all very much,
    Strangely enough even though I had gotten the " Install failed....Mac OS X could not be installed on your computer....The install could not copy the necessary support files"  I had left it on the screen and left the room for awhile. I walked back into my computer room a few minutes ago and the window on the screen stated that the SL OS 10.6.4 had successfully installed. I am now very carefully checking things out to make sure the fonts are where they should be. With the exception of some updating it appears all may be well.
    PS. Below is a note I was writing to Kurt (also assisting me) to try and detail what had happened. Added it in case it could be of any value to you
    Kurt,
    Thank you for response. following is series of events to my best recollection.
    I would typically not have been this stupid/ignorant but was doing this in a hurry with someone asking me questions...wasn't paying attn. to what I was doing
    • downloaded new fonts
    • opened downloaded fonts, clicked font icons to open and install them.
    • typed "fonts" in spotlight (with the intention of moving new fonts into font folder)The Spotlight results window revealed 5 or 6 font folders. I ignorantly started to try a clean up by installing all fonts into a single folder (not thinking about system fonts)
    Sometimes when you are moving a folder the window you moved it from will jump around..well this occurred and I mistakenly released the folder on the desk top. This caused a copy to be made. After some investigation I realized it was a copy of the required system fonts that were still located in the original "spotlight results" window.
    • I attempted to delete the copy..when I did an administrator password box appeared I entered the password and the result was both system font folders were deleted (the original & the desk top copy I erroneously made)
    • Now windows open but are blank with sometimes faded mini sized icons. If I click one of the mini icons i get a new blank window. I am unable to give any instruction, have total blank menus, dialog boxes, etc.
    I can open the some of the items that have icons in the apple dock at bottom of page in the 

  • Not able to set Weblogic Runtime on eclipse while adding new weblogic srvr

    Hi Everyone,
    I downloaded Oracle Integration pack for eclipse by clicking at "Download additional server adapters". I am not able to set Weblogic Runtime on eclipse while adding new weblogic server.
    I am trying to give following values:
    Name :Oracle WebLogic Server 10gR3 (2)
    Weblogic home :C:\bea\wlserver_10.3
    Java home: C:\bea\jrockit_160_05
    Below it I am getting "No applicable extension found" and finish button is greyed out.
    Please help in telling what is wrong. Never faced such an issue.
    Thanks
    SM

    I found this problem too.
    OS:windows7、eclipse:helios、oepe:Part of Oracle Enterprise Pack for Eclipse 11.1.1.7.3
    <workspace>\.metadata\.log:
    !ENTRY org.eclipse.osgi 2 1 2012-06-05 00:16:06.357
    !MESSAGE NLS unused message: enter_new_hit_count in: org.eclipse.wst.jsdt.debug.internal.ui.messages
    !ENTRY org.eclipse.osgi 2 1 2012-06-05 00:16:06.357
    !MESSAGE NLS unused message: exception_occurred_setting_bp_properties in: org.eclipse.wst.jsdt.debug.internal.ui.messages
    !ENTRY org.eclipse.osgi 2 1 2012-06-05 00:16:06.357
    !MESSAGE NLS unused message: hit_count_must_be_positive in: org.eclipse.wst.jsdt.debug.internal.ui.messages
    !ENTRY org.eclipse.osgi 2 1 2012-06-05 00:16:06.357
    !MESSAGE NLS unused message: no_description_provided in: org.eclipse.wst.jsdt.debug.internal.ui.messages
    !ENTRY org.eclipse.osgi 2 1 2012-06-05 00:16:06.357
    !MESSAGE NLS unused message: scripts in: org.eclipse.wst.jsdt.debug.internal.ui.messages
    !ENTRY org.eclipse.osgi 2 1 2012-06-05 00:16:06.357
    !MESSAGE NLS unused message: select_javascript_file in: org.eclipse.wst.jsdt.debug.internal.ui.messages
    !ENTRY org.eclipse.osgi 2 1 2012-06-05 00:16:06.357
    !MESSAGE NLS unused message: set_bp_hit_count in: org.eclipse.wst.jsdt.debug.internal.ui.messages
    !ENTRY org.eclipse.osgi 2 1 2012-06-05 00:16:06.357
    !MESSAGE NLS unused message: suspend_target in: org.eclipse.wst.jsdt.debug.internal.ui.messages
    !ENTRY org.eclipse.osgi 2 1 2012-06-05 00:16:06.357
    !MESSAGE NLS unused message: suspend_thread in: org.eclipse.wst.jsdt.debug.internal.ui.messages
    !ENTRY org.eclipse.osgi 2 1 2012-06-05 00:16:06.357
    !MESSAGE NLS unused message: the_argument_0_is_not_valid in: org.eclipse.wst.jsdt.debug.internal.ui.messages
    I tried the weblogic 10.3.1、10.3.3、10.3.4、10.3.5 still show the info that "No applicable extension found" and finish button is greyed out.
    What is the reason?
    thanks!

  • Warning while adding new ECC

    Hi ,
    I am getting error while adding new ECC variable in ICM. PFB the error message.
    " The Maximum size of all Expanded Call Variable in the Computer Telephony Integeration Server is 2500 bytes. Saving these schanges would require 2795 bytes.
    will this hamper the performance of the system..?

    Hi, no, it will not work at all, so no worries about system performance.
    Why are you adding a new ECC variable when the system tells you it wont fit?
    G.
    Sent from Cisco Technical Support Android App

  • I have recently upgraded to ios 7 on my iphone. I am currently at 7.0.2 which i installed yesterday. Now i notice that the keypad doesnt appear in any function under Phone. Keypad doesnt show up in contact search, or while adding new contacts or editing.

    I have recently upgraded to ios 7 on my iphone. I am currently at 7.0.2 which i installed yesterday. Now i notice that the keypad doesnt appear in any function under Phone. Keypad doesnt show up in contact search, or while adding new contacts or editing the existing. This is irritting.

    Try This...
    Close All Open Apps... Sign Out of your Account... Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430

  • What is the default group id/ home /shell while adding new account with useradd without specifying these parameters?

    What is the default group id/ home /shell while adding new account with useradd without specifying these parameters?
    reagrds

    Hi,
    You can check the default values from the below file
    /usr/sadm/defadduser
    and from this command
    #useradd -D

  • How to create an SPList by adding SPListItems from List SPListItem ?

    Hi there,
    I have List<SPListItem> as below that contains many SPListItems.
    List<SPListItem> Output = new List<SPListItem>();
    How to create an SPList or SPLIstItemCollection from above please?
    Thank you so much.

    Hi Frob,
    Thanks for posting this issue, Kindly find the below mentioned steps. I hope you should be able to create a new collection.
    Get a instance of the list you want to add the item to.
    Add a new item to the list:
    SPListItem newItem = list.AddItem();
    To bind you new item to a content type you have to set the content type id for the new item:
    newItem["ContentTypeId"] = <Id of the content type>;
    Set the fields specified within your content type.
    Commit your changes:
    newItem.Update();
    I hope this is helpful to you. If this works,  Please mark it as
    Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • I have a new Macbook pro and can't recall the password I used with my Time capsule - How can I (ideally) retrieve or possibly change the time capsule password?

    I have a new Macbook pro and can't recall the password I used with my Time capsule - How can I (ideally) retrieve or possibly change the time capsule password?

    Remember security on a TC is an illusion.
    Simply press the reset button for 1-2 sec.. you must not do too long .. it will then hard reset.. but soft reset will revert all passwords to default for 5min. ie TC password is now public.
    Remember this the next time because anybody at all can change your passwords.
    Once into the TC you can then open the view passwords if you wanted any weaker security. Click and open the TC.. and click on edit.. then go to the top menu..
    Voila .. all your passwords in plain sight to any Tom Dick and Fred.

  • HT2731 how to create a free apple id without puttin in the cridit card info?

    how to create a free apple id without puttin in the cridit card info?
    Card type "None" option is not available

    Welcome to the Apple Community.
    To be able to download free apps without a recognised method of payment or gift card.
    Open iTunes and navigate to the app store. Select a free app to download. A simple way to do this is to scroll down to the top free apps box on the right hand side, hover your mouse over the first item and click on the free button that appears when you hover over it.
    A pop up will open asking you to sign in with your Apple ID click "create new account", click continue to create your account. Check the box to accept the store terms and conditions and click continue.
    Enter your email address, password, security question, and date of birth, click continue. Now, you will be asked to provide a payment method. Note now that the last option says "none".

  • How to create a program that accepts 5 digits from the user between 0 and 9

    how to create a program that accepts 5 digits from the user between 0 and 9 then put them in ascending order using link-list method..

    You can use a scanner to get user input from the command line.
    import java.util.*;
    public class Test {
        private List<Integer> list;
        private Scanner in;
        public static void main (String... args) {
            new Test ();
        public Test () {
            list = new LinkedList<Integer> ();
            in = new Scanner (System.in);
            for (int i = 0; i < 5; i ++) {
                System.out.format ("Please enter a number (%d more): ", (5 - i));
                list.add (in.nextInt ());
            Collections.sort(list, new Comparator<Integer> () {
                public int compare (Integer i1, Integer i2) {
                    return i2 - i1;
            System.out.println (list);
    }

  • How to create multiple BOM of same parent item?

    Hi All,
    Please guide me, How to create multiple BOM of same parent item? I tried but system throws a message as same Parent Item already exist in the table. I am afraid if system supports this functionality or not?

    Hi,
    You are welcome.......
    Well the exact process would be as I mentioned in my previous post.
    1. Create the BOM for an item
    2. Choose this item in the Production Order
    3. Then in this Production order you can change/ delete/ add whichever item you want .
    OR
    If all the child items are completely different from the original BOM then you can use the Special Type BOM in which you can always create the BOM while creating the Production Order itself. There is no standard BOM here.
    J Nagesh

  • How to create xforms binding-excaption of xml file in the xhtml source?

    Hello,
    is anyone here who could help me?
    I've spent plenty of hours by searching the correct and suitable way for creating a binding exception in XForms, but I did not succeed...
    My situation is: I've got an XHTML page with XForms and XML (input) file, which describes this page. Whenewer I change the input data in the XML file (for example there are tags <person> and ....</person> if I change it to <peson1> and ...</person1>) after saving the changes and refreshing the page, the XForms will be changed (for example some text fields are missing or they've got white background instead red one, which there was before et cetera). {I hope it is clear till now.....}
    My task is: to create a xforms-binding-expression event, which will display an error message (for example: FILE HAVE BEEN CHANGED, CAN NOT DISPLAY THE PAGE PROPERLY) to the user.
    i've found some stuff, how to create such message, but i need to know the exact order of commands to make it work, where to insert them, the structure etc, so I can comprehend your advices...
    The XHTML file contains of several blocks - bind, model, submission, instance etc - and I do not actually know, where to insert such lines (with message)...I think I should make some bindings with the page loading, but I've got no idea how to get it done, however there are very few sites with such stuff on the internet. I hope this task is no big deal for you gyus, THANK YOU A LOT IN ADVANCE

    Hello,
    is anyone here who could help me?
    I've spent plenty of hours by searching the correct and suitable way for creating a binding exception in XForms, but I did not succeed...
    My situation is: I've got an XHTML page with XForms and XML (input) file, which describes this page. Whenewer I change the input data in the XML file (for example there are tags <person> and ....</person> if I change it to <peson1> and ...</person1>) after saving the changes and refreshing the page, the XForms will be changed (for example some text fields are missing or they've got white background instead red one, which there was before et cetera). {I hope it is clear till now.....}
    My task is: to create a xforms-binding-expression event, which will display an error message (for example: FILE HAVE BEEN CHANGED, CAN NOT DISPLAY THE PAGE PROPERLY) to the user.
    i've found some stuff, how to create such message, but i need to know the exact order of commands to make it work, where to insert them, the structure etc, so I can comprehend your advices...
    The XHTML file contains of several blocks - bind, model, submission, instance etc - and I do not actually know, where to insert such lines (with message)...I think I should make some bindings with the page loading, but I've got no idea how to get it done, however there are very few sites with such stuff on the internet. I hope this task is no big deal for you gyus, THANK YOU A LOT IN ADVANCE

  • How to create  a procedure to send a mail if the Database is down?

    Hi,
    I have created the below procedure to send a mail if the count is less than 1300. It scheduled daily @ 15 30 hrs. Its fine.
    CREATE OR REPLACE procedure SCOTT.hrsmail
    is
    v_count number;
    begin
    Select count(*) into v_count from emp;
    if v_count < 1300
    then
    UTL_MAIL.send(sender => '[email protected]',
    recipients => '[email protected]',
    cc => '[email protected]',
    bcc => '[email protected]',
    subject => 'Testing the UTL_MAIL Package',
    message => 'If you get this, UTL_MAIL package
    else
    null; --what you want to do here
    end if ;
    end;
    Sometime the Database is down, so the job is not running.
    How to create a procedure to send a mail if the database is down?
    Pls help me. Its highly appreciated.
    Thanks
    Nihar

    nihar wrote:
    How to create a procedure to send a mail if the database is down?And what if the database is up, but the network down? Or the database up and mail server down? Or mail server undergoing maintenance?
    There are loads of "+What if's+" - and in that respect, playing "+What if database is down..+" in this case does not make any sense. You do not use the database to monitor its own up/down status. You do not rely just on SMTP as notification protocol that the database is down.
    The correct approach would be using something like SNMP as the monitoring protocol. A monitoring system that can process SNMP and perform some basic root cause analysis (e.g. network to the database server down, database server status unknown). And this system supporting notification methods like SMTP, SMS and so on.

Maybe you are looking for