Javascript or Ajax Lovs.

Hi,
I wanted to creat dependent Lovs in javascript or Ajax, but dont know where to start. Perhaps there are similar examples available?
I wanted to make something like this "without page submit":
lov_continent: Europe
lov_countrie:Germany, France, England,Belgium ...."available if i choose europe"
lov_region:bayern, hessen ...."available if i choose Germany"
i am very Thankful if someboby can give me some help
Thank's!

Hi Denes,
I have try your example in my aplication and it works fine for continent ---country!
But what have i to do to make it work for continent ---country--- Region?
I have try to use two time "one in header and the other in footer" the javascript function: function get_select_list_xml and function appendToSelect.
Basicaly i have repeat the steps in your example two times , thing it should work!
How can i use 2 times this javascript functions?
Example on:
http://apex.oracle.com/pls/otn/f?p=46268:4:1764040056310127::NO
workspace:pepe, username:pepe, password:pepe25
Thank's in advance

Similar Messages

  • AIR with JavaScript and AJAX (noob design issues)

    Okay, so as the subject states, I'm a noob when it comes to designing an AIR app. My question is kind of two fold:
    First, as a matter of design, I've got a main window that has several drop-down type menus "File", "Preferences", "Help" that kind of thing. My plan was to keep reusing the main window for each of my different screens (unless a pop-up/dialog type screen was called for)
    Anyway, the application I'm writing will, in part, handle a database of patrons. So under one of the menus (File in this case) I've got a "Patron" option. Clicking on "Patron" fires a function called newPatron() which in turn calls my function ebo.displayScreen('patron.htm'). This latter function takes the filename passed in and reads that file then dumps it's contents out to the main screen.
    So, my main window consists (in part) of the following html:
    <body onload="ebo.doLoad();">
         <div id="content"></div>
    </body>
    then my displayScreen function looks like this:
    function displayScreen(filename){
         var my = {};
         // get a handle on the file...
         my.file = air.File.applicationDirectory(resolvePath(filename);
         // get a handle on the stream...
         my.stream = new air.FileStream();
         //open the stream for read...
         my.stream.open(my.file, air.FileMode.READ);
         // read the data...
         my.data = my.stream.readUTFBytes(my.stream.bytesAvailable);
         // close the stream...
         my.stream.close();
         // update the screen (I'm using jQuery here)
         $("#content").empty().append(my.data);
    So anyway, this works like a champ. I click on "Patron" from my file menu and the screen changes to display the contents of patron.htm.
    Currently, patron.htm just contains the following:
    <div style="text-align:left;">
         <input type="button" value="add" onclick="ebo.add(1,2);" />
    </div>
    <div id="result"><div>
    ebo.add looks like this:
    function add(a,b){
         var my = {};
         my.result = a + b;
         $("#result").empty().append(my.result + "<br />");
    So, if anyone hasn't guessed by now, the code contained in the ebo namespace gets included on the main screen when the application loads, and my problem is that despite the fact that once the patron.htm file is loaded in the content div by clicking on the menu option, my button on that screen refuses to work. I've even tried just having the button do an alert directly,
    <input type="button" value="add" onclick="alert('AIRRocks!');" />
    but even that fails!
    So, I added some code to the main page to test a button from there...
    <body onload="ebo.doLoad();">
         <input type="button" value="add" onclick="ebo.add(1,10);" />
         <div id="result"></div>
         <div id="content"></div>
    </body>
    So, now when the main screen loads, I get an "add" button and when I click it the number 11 appears in the "result" div. When I click on the Patron menu option, the new html and javascript are loaded into the "content" div, but the add button in that area refuses to work!
    What gives? I'm sure I'm missing something. So I guess the two questions are: is my scheme of loading new content into the main window by reading the contents of a file, flawed in some way? Or am I just missing something about making calls from this dynamically loaded content? It *looks* like it should work fine, but if I can't make javascript calls from the resultant content, then the concept is no good.
    I realize this has been a somewhat long winded post, but hopefully it describes in enough detail the problem I'm having. I should maybe add that I've looked at what's in the DOM using the AIR HTML/JS Application Inspector and it looks like everything should work perfectly.
    I hope someone out there can help me and might have the patience to explain where I've gone wrong. I might also mention that the only book I've read (or am reading) on AIR with JavaScript and AJAX is "Adobe AIR (Adobe Integrated Runtime) with Ajax: Visual QuickPro Guide"... it really hasn't covered aspects of what makes good design (like what's the best way to reuse the main application window to hold interactive content)... but anyway, there you have it.
    Again, I hope someone can help me out.
    Thanks!
    Chris

    Thanks for responding, Andy. I don't think I'm losing my namespace. That
    thought had crossed my mind, which is why (and I thought I put this in my
    original post) I tried putting a somple alert in the onclick event of the
    button in my "patron.htm" file... but that simple alert doesn't even work.
    :o(
    Do you still think it's an issue with the namespace?

  • Disable Javascript Alert AJAX Error Messages

    Anyone know how to disable the javascript popups that come up
    if an AJAX component of CF8 errors out? People paste weird stuff in
    the built-in FCK (cftextarea) all the time and it errors out,
    degrading into a regular text box, which is fine, but the
    javascript error that comes up scares and confuses them.

    <HTML>
    <HEAD><TITLE>Simple Page</TITLE></HEAD>
    <BODY BGCOLOR="#FDF5E6">
    <P>
    <CENTER>
    <%@ taglib uri="http://struts.apache.org/tags-html"
               prefix="html" %>
    <html:errors/>
    <html:form action="/actions/register"
               onsubmit="return validateRegisterFormBean(this);">
      First name: <html:text property="firstName"/><BR>
      Last name: <html:text property="lastName"/><BR>
      Mailing address: <html:text property="address"/><BR>
      ZIP Code: <html:text property="zipCode"/><BR>
      Email address for confirmation:
      <html:text property="email"/><BR>
      <html:submit value="Register Now!"/>
    </html:form>
    <html:javascript formName="registerFormBean"/>
    </CENTER>
    </BODY></HTML>This is the code.
    I am getting error messages in the form itself rather than in a message box.

  • Ajax LOVs with a SQL source

    Hi,
    I have two pages that I'm using I'm using Ajax to populate cascading Lov's(town and suburb). One page is a create record page, and the other is an edit of the same record. I have 2 LOV's. On the 'create' page the ajax works perfectly and allows me to choose a suburb(LOV2) based on the town(LOV1) selected in LOV1, however in the edit page the suburb selected does not show in LOV2 even though I am passing it in the source(SQL query). I want LOV2 to show the suburb selected then if you click on the dropdown, show the other suburbs available under the town selected in LOV1.
    Any ideas?Or is there a more elegant way to handle this?
    Thanks

    Hi
    Here it is:
    .00:
    0.00: S H O W: application="173" page="10" workspace="" request="" session="6993176175380586"
    0.01: Language derived from: FLOW_PRIMARY_LANGUAGE, current browser language: en-us
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: NLS: CSV charset=WE8MSWIN1252
    0.01: ...NLS: Set Decimal separator="."
    0.01: ...NLS: Set NLS Group separator=","
    0.01: ...NLS: Set date format="DD-MON-RR"
    0.01: ...Setting session time_zone to +00:00
    0.01: Setting NLS_DATE_FORMAT to application date format: DD/MM/YYYY
    0.01: ...NLS: Set date format="DD/MM/YYYY"
    0.01: NLS: Language=en-us
    0.01: Application 173, Authentication: CUSTOM2, Page Template: 55669127687495456
    0.01: ...Determine if user "WEYKU6B3" workspace "31732801716199613" can develop application "173" in workspace "31732801716199613"
    0.01: ...ok to reuse builder session for user:ANONYMOUS
    0.01: ...Application session: 6993176175380586, user=ANONYMOUS
    0.01: ...Determine if user "WEYKU6B3" workspace "31732801716199613" can develop application "173" in workspace "31732801716199613"
    0.01: ...Check for session expiration:
    0.01: Session: Fetch session header information
    0.01: Saving g_arg_names=P10_E_ID and g_arg_values=314
    0.02: Fetch session state from database
    0.02: ...Session State: Save Item "P10_E_ID" newValue="314" "escape_on_input="N"
    0.02: Saving g_arg_names=P10_PR_ID and g_arg_values=
    0.02: ...Session State: Save Item "P10_PR_ID" newValue="" "escape_on_input="N"
    0.02: ...Metadata: Fetch page attributes for application 173, page 10
    0.02: Branch point: BEFORE_HEADER
    0.02: Fetch application meta data
    0.03: Setting NLS_DATE_FORMAT to application date format: DD/MM/YYYY
    0.03: ...NLS: Set date format="DD/MM/YYYY"
    0.03: Computation point: BEFORE_HEADER
    0.03: Processing point: BEFORE_HEADER
    0.03: ...Process "GET_NEXT_E_ID": PLSQL (BEFORE_HEADER) DECLARE v_e_count NUMBER; BEGIN select count(1) into v_e_count from ENTITY where E_ID > :P10_E_ID; IF v_e_count > 1 THEN SELECT MIN(E_ID) INTO :P10_NEXT_E_ID FROM ENTITY WHERE E_ID > :P10_E_ID; END IF; END;
    0.03: ...Session State: Save Item "P10_NEXT_E_ID" newValue="334" "escape_on_input="N"
    0.03: ...Process "GET_PREV_ID": PLSQL (BEFORE_HEADER) DECLARE v_e_count NUMBER; BEGIN select count(1) into v_e_count from ENTITY where E_ID < :P10_E_ID; IF v_e_count > 1 THEN SELECT MAX(E_ID) INTO :P10_PREV_E_ID FROM ENTITY WHERE E_ID < :P10_E_ID; END IF; END;
    0.04: Show page template header
    0.04: Computation point: AFTER_HEADER
    0.04: Processing point: AFTER_HEADER
    ANONYMOUSLogout
    0.04: Computation point: BEFORE_BOX_BODY
    0.04: Processing point: BEFORE_BOX_BODY
    0.04: Region: Edit Buyer
    Edit Buyer

  • Ajax/Javascript in Web dynpro ABAP

    Hi,
    I need your help in figuring out what artefacts of web dynpro ABAP could help me resolve a problem.
    In a Web dynpro abap application, we have a button that redirects a user to an external site. Some of our users can go to this site from their computer and some others can't because they are not allowed. I would like to be able to show the button only to the users that have the right to execute this navigation.
    In order to do that, I need to embed some script in my web dynpro application that will test if the URL of this application sends back an HTTP/200.
    With the latest versions of Web Dynpro ABAP, is it possible to embed javascript of ajax? How can it be done?
    If not, what could I use to base the visibility of my button on a validation that has to run on the users's browser?
    Thank you very much for your help!
    Renaud

    Another way it could be done creating a custom ztransaction (abap report) performing a PING to the ip server , reading log txt,  saving if the user is authorized or not , and redirecting to the Abap Web Dynpro.
    Then On wddoinit select zztable for authorization.
    But i don't know if this solution will work for you (ping specific port 80? or other requirements)
    DATA: workdir TYPE string,
          path_log TYPE string,
          parameter TYPE string.
    TYPES: BEGIN OF tylog,
         line(1000),
      END OF tylog.
    DATA: t_log TYPE TABLE OF tylog,
          v_log LIKE LINE OF t_log.
      DATA:  appl_name TYPE string,
                abs_url TYPE string.
    START-OF-SELECTION.
      CALL METHOD cl_gui_frontend_services=>get_sapgui_workdir
        CHANGING
          sapworkdir = workdir.
      CONCATENATE '/C ping google.it >' workdir
      INTO parameter SEPARATED BY space. "example google
      CONCATENATE parameter '\pinglog.txt' INTO parameter.
      CALL METHOD cl_gui_frontend_services=>execute
         EXPORTING
    *    document               =
           application            = 'CMD'
           parameter              = parameter
           synchronous            = 'X'.
      CONCATENATE workdir  '\pinglog.txt' INTO path_log.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = path_log
          filetype                      = 'ASC'
        TABLES
          data_tab                      = t_log.
      LOOP AT t_log INTO v_log WHERE LINE CS 'Lost = 0'.
        EXIT.
      ENDLOOP.
    if sy-subrc = 0. "ping ok
    zzping-uname = sy-uname.
       zzping-authorized = 'X'.
    else.
      zzping-uname = sy-uname.
      zzping-authorized = ' '.
      endif.
       INSERT ZZPING.
    **construct web dynpro url and call browser
      cl_wd_utilities=>construct_wd_url( EXPORTING application_name = appl_name
                                                                 IMPORTING out_absolute_url = abs_url ).
    CALL FUNCTION 'CALL_BROWSER'
      EXPORTING
        URL                          = abs_url.
    Edited by: alessandro spadoni on Mar 24, 2011 10:09 PM
    Edited by: alessandro spadoni on Mar 24, 2011 10:31 PM

  • AJAX - JavaScript - HTML

    Hi all,
    I am currently trying to find editors or IDEs for AJAX,HTML,Java.
    I am currently using Eclipse for my JAVA projects. Can you please suggest me which editor do you prefer to write html,javascript, or AJAX. I am not really interested in visual editing just code.
    Thank you all take care
    Adam

    You'd be better off posting this question in an HTML, Javascript or AJAX forum.

  • JavaScript / Ajax Technology

    Hi,
    I am not familiar with JavaScript and Ajax technology. What is the best tutorial/web sites/books to start learning this...
    NB: the example in Carl and Vikas are a littre be complicated for me (example : show_hide...)
    Cheers

    Hello,
    This site has very good beginner tutorials on javascript , ajax and css
    http://www.w3schools.com/js/default.asp
    Carl

  • How to retain value in LoV item in Tabular Form, after Page Refresh

    Hi,
    I have a tabular form, which contains 2 items(columns), of type "Select List - named LoV".
    Now, 2nd item(column) in tabular form, that LoV should get populated based on user's selection value in first item LoV.
    1. So how do I refer to the value, that user selected in first item's LoV? I will have to use this value as reference in LoV query of my 2nd item ( on this tabular form)
    2. Everytime I select value in first item LoV, page gets refreshed, as my requirement is to calculate 2nd item's LoV based on selected value in first item. So after this page refresh, first item LoV loses its value that was selected before the page refresh happened. So how do i retain this value in first item LoV? I have an unconditional process, that on every submit(refresh) of page, I set all my items with their corresponding values. But problem is what do i mention there to refer to this first item ( of type LoV) of tabular form?
    I looked in view source of my page, this item is referred as f03.
    So i used "apex_application.g_f03", to set this item to its value, in my uncoditional submit process. But it did not work. I tried to refer this item as "f03" in this unconditional submit process. But still it did not help, the selected item loses its value after page refresh(submit).
    Please help.
    Thanks and Regards,
    Ravi.

    Hi Rave,
    You will have to use Javascript and Ajax to change the values as ApEx submissions will lose your results unless they are saved into the database.
    Remember, that as you are using a tabular form there will be lots of items called f01, fo2, fo3 etc on the page (one per row).
    Regards
    Michael
    Edited by: MKii on Jun 4, 2009 10:13 AM

  • How to toggle a region in AJAX

    I have 5 regions in a page and each region may contain upto 10 items. Currently these regions are show/hide type based on "self submit select list" value at the top of the page.Now, I need to convert this self submit LOV to Ajax style LOV. If I convert the LOV to AJAX type, how can show/hide the regions as soon as the LOV value is changed without submitting/refreshing page?. I have used "$x_ToggleItemRow(['P1_ITEM','P2_ITEM']);" call to toggle an item and works fine, but not sure how to do the toggle for a region based on AJAX LOV value. any ideas are appreciated.
    thanks for your help,
    Surya

    I feel a little bit stupid but I can't get this to work...
    I have a report (tabular form) where I want to have a link of each row to show a region with values.
    I have a link in my report:
    target: URL
    URL: javascript:$x_Toggle(l_Item)
    In page header:
    <script>
    var l_Item = '999';
    var l_Items = ['TEST_REGION_1','TEST_REGION_2','TEST_REGION_3'];
    </script>
    On the region I want to show/hide I set Static Id = 999
    Changed the template to:
    <table width="100%" border="0" cellspacing="0" cellpadding="0" id="#REGION_STATIC_ID#" class="t3ReportsRegion" summary="">
    <tr>
    <td valign="bottom" class="t3RegionHeader">#TITLE#</td>
    <td class="t3ButtonHolder" align="right">#CLOSE#   #PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</td>
    </tr>
    <tr class="t3instructiontext">
    <td colspan="2" valign="top" class="t3Body">#BODY#</td>
    </tr>
    </table>
    What am I doing wrong??
    Regards Daniel

  • Tomcat 5.5, struts, AJAX - Works on localhost but not on online web-server

    Hello,
    I'm trying to add some functionality from Ajax to my client's web application. And I'm stuck on this problem for the past 4 days now.
    To make a long story short, the application works perfectly on my localhost, but once I deploy it to the online server it pops a Page Not Found message (written in the JavaScript of Ajax engine). Though I have worked with servlets and struts a bit, I still consider myself very new.
    Here are some specifications:
    - The jar files are in tomcat-5.5/common/lib
    - The servlets (compiled correctly) are in webapps/ROOT/WEB-INF/classes/javaClasses
    - My web.xml and struts-config.xml are in WEB-INF, both of which I believe are configured correctly:
    web.xml
    =======
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
         <servlet>
              <servlet-name>action</servlet-name>
              <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
              <init-param>
              <param-name>config</param-name>
              <param-value>/WEB-INF/struts-config.xml</param-value>
              </init-param>
         </servlet>
         <servlet-mapping>
              <servlet-name>action</servlet-name>
              <url-pattern>*.do</url-pattern>
         </servlet-mapping>
         <welcome-file-list>
              <welcome-file>/index.jsp</welcome-file>
         </welcome-file-list>
    </web-app>
    struts-config.xml
    ==============
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
    <struts-config>
    <action-mappings>
    <action path="/signup" type="org.apache.struts.actions.ForwardAction" parameter="/signup.jsp" />
    <action path="/countries" type="javaClasses.GetCountries" />
    </action-mappings>
    </struts-config>
    I noticed when I type "countries.do" on my localhost, the action is processed perfectly, however on the online server, it displays me the 404 error page.
    I thought it wasn't seeing the struts-config.xml so I played around with the directory path struts-config.xml and replaced it with:
    <param-value>/home/shaghig/webapps/ROOT/WEB-INF/struts-config.xml</param-value>
    but still no luck.
    What is it that I am not doing right? Any input or guidance would be very much appreciated.

    Have you resolved your problem? I am running into the SAME EXACT issues with my application. The only difference is I'm not deploying to webapps/ROOT/; I'm deploying to my own directory based on my WAR file name (webapps/<web_application_name>/WEB-INF....blah blah). If you figured out your problem (believe me, I wish I could be of some help) I would LOVE to hear what you did/figured out.
    -C

  • Highlight LOV extra value

    See https://apex.oracle.com/pls/apex/f?p=57688:17
    The select list has a LOV of *1,2,3* with Show Extra Values = Yes. The Source attribute forces a value of Extra
    Question - How can the extra value be highlighted with, say a colored background, to draw attention to it?
    Thanks

    VANJ wrote:
    See https://apex.oracle.com/pls/apex/f?p=57688:17
    The select list has a LOV of *1,2,3* with Show Extra Values = Yes. The Source attribute forces a value of Extra
    Question - How can the extra value be highlighted with, say a colored background, to draw attention to it?Do you have any easy way to determine which option is the "extra" value (in JavaScript) across the LOVs you're interested in? For example: all of the known values have numeric <tt>value</tt> attributes, only the extra one is text; or the displayed option text is always different from the options <tt>value</tt> attribute for known values, only the extra one's text and <tt>value</tt> will be the same?
    If not (or if you want a generic, foolproof approach) then all I can think of is an AJAX Dynamic Action that collects the list's <tt>value</tt> attributes, sends them to the server for comparison with the item's known LOV values, and returns the difference. It's possible that getting the current, known LOV values for the item may not be trivial.

  • Step by step to try AJAX Select LIST

    Hi Pakars
    Please describe step by step,
    how to create Ajax Select list ?
    Refer in this
    http://apex.oracle.com/pls/otn/f?p=11933:37:8080121466477345
    Thanks

    Hi,
    I use these instructions to create an AJAX lov, hope they help
    1 - Under shared components create an item called TEMPORARY_ITEM
    2 - Under shared components create an application process
    declare
    l_counter number;
    l_o_name varchar2(2000);
    begin
    owa_util.mime_header('text/xml', FALSE );
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<select>');
    for rec in (select VALUE_HEADER_ID as "VALUE_HEADER_ID",
    LOV_VALUE as "LOV_VALUE",
    LOV_VALUE_ID as "LOV_VALUE_ID"
    from TST_LOV_VALUES Where VALUE_HEADER_ID = :TEMPORARY_ITEM )
    loop
    htp.prn('<option value="' || rec.LOV_VALUE_ID || '">' || rec.LOV_VALUE || '</option>');
    end loop;
    htp.prn('</select>');
    end;
    Change the select in bold to match the sub LOV
    3 - Add the following javascript to the html header of the page
    <script language="JavaScript" type="text/javascript">
    <!--
    htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    function get_AJAX_SELECT_XML(pThis,pSelect,pName,pNullDefault){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,pName,0);
    get.add('TEMPORARY_ITEM',pThis.value);
    gReturn = get.get('XML');
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    if ( pNullDefault == true )
    appendToSelect(l_Select,'','') ;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
    get = null;
    function appendToSelect(pSelect, pValue, pContent) {
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){/* why is ie different ask bill */
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    //-->
    </script>
    4 - Create the first LOV abd in the HTML Form Element Attributes add the following text
    onblur="get_AJAX_SELECT_XML(this,'P2_CHILD','APPLICATION_PROCESS=CHILD_Select_XML',false)"'
    5 - Create the sub lov
    Ensure the List of values definition relates to the main lov in the where clause e.g.
    select LOV_VALUE d, LOV_VALUE_ID r
    from TST_LOV_VALUES
    where VALUE_HEADER_ID = :P2_HEADER

  • How to create a Document Set in SharePoint 2013 using JavaScript Client Side Object Model (JSOM)?

    Hi,
    The requirement is to create ""Document Sets in Bulk" using JSOM. I am using the following posts:-
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/1904cddb-850c-4425-8205-998bfaad07d7/create-document-set-using-ecma-script
    But, when I am executing the code, I am getting error "Cannot read property 'DocumentSet' of undefined "..Please find
    below my code. I am using Content editor web part and attached my JS file with that :-
    <div>
    <label>Enter the DocumentSet Name <input type="text" id="txtGetDocumentSetName" name="DocumentSetname"/> </label> </br>
    <input type="button" id="btncreate" name="bcreateDocumentSet" value="Create Document Set" onclick="javascript:CreateDocumentSet()"/>
    </div>
    <script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"> </script>
    <script type="text/javascript">
       SP.SOD.executeFunc('sp.js','SP.ClientContext','SP.DocumentSet','SP.DocumentManagement.js',CreateDocumentSet);
    // This function is called on click of the “Create Document Set” button. 
    var ctx;
    var parentFolder;
    var newDocSetName;
    var docsetContentType;
    function CreateDocumentSet() {
        alert("In ClientContext");
        var ctx = SP.ClientContext.get_current(); 
        newDocSetName = $('#txtGetDocumentSetName').val(); 
        var docSetContentTypeID = "0x0120D520";
        alert("docSetContentTypeID:=" + docSetContentTypeID);
        var web = ctx.get_web(); 
        var list = web.get_lists().getByTitle('Current Documents'); 
        ctx.load(list);
        alert("List Loaded !!");
        parentFolder = list.get_rootFolder(); 
        ctx.load(parentFolder);
        docsetContentType = web.get_contentTypes().getById(docSetContentTypeID); 
        ctx.load(docsetContentType);
        alert("docsetContentType Loaded !!");
        ctx.executeQueryAsync(onRequestSuccess, onRequestFail);
    function onRequestSuccess() {       
        alert("In Success");
        SP.DocumentSet.DocumentSet.create(ctx, parentFolder, newDocSetName, docsetContentType.get_id());
        alert('Document Set creation successful');
    // This function runs if the executeQueryAsync call fails.
    function onRequestFail(sender, args) {
        alert("Document Set creation failed" + + args.get_message());
    Please help !!
    Vipul Jain

    Hello,
    I have already tried your solution, however in that case I get the error - "UncaughtSys.ArgumentNullException: Sys.ArgumentNullException:
    Value cannot be null.Parameter name: context"...
    Also, I tried removing SP.SOD.executeFunc
    from my code, but no success :(
    Kindly suggest !!!
    Vipul Jain

  • Help required for using ajax in netweaver

    Hi..
    Can i Use Ajax for my netweaver applications?? If yes, then how?? Any pointers regarding that will be adequately rewarded points..
    Thanks

    For pure JavaScript enabled AJAX application, no problem. You just write the application as usual and send XMLHttpRequest with parameters to server, then update the web page with your JavaScript code;
    I can show you some sample code here:
    <script type="text/javascript">
            function createXMLHttpRequest() {
                 var xmlHttp;
                if (window.ActiveXObject) {
                        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                else if (window.XMLHttpRequest) {
                        xmlHttp = new XMLHttpRequest();
                return xmlHttp;
            function onclick_changeModelHouse(id) {
                var xmlHttp = createXMLHttpRequest();
                xmlHttp.onreadystatechange = function(){
                     if(xmlHttp.readyState == 4) {
                          if(xmlHttp.status == 200) {
                               // here you get your page component with id or any you like,
                                    // then update it with data returned from the request you sent;
                                   // Here I update one image url path;
                                  var img = document.getElementById("houseModel");
                                   // suppose you return the image file name;
                         img.innerHTML="<img src='images/" + xmlHttp.responseText +  "'>";
                xmlHttp.open("GET", "http://myserver:8080/myApp//AjaxImageService?model="+id, true);
                xmlHttp.send(null);
    </Script>
    For some button in your page you add javascript code like
    onClick="onclick_changeModelHouse(id)"
    somthing.
    You need develop servlet to response your request, and usually you need pass back your data in XML format, here I just use plain text for easy understanding.

  • Upload large file on doSubmit in javascript

    Hi all,
    I'm currently having some problems uploading large files using a custom Upload button (button calls doSubmit from javascript).
    When using an Upload button with unconditional branch to the same page (no js) it works perfectly. Now I have to use my own Upload button that calls some javascript and AJAX and then Submit the page (with doSubmit); in this case I can only upload very small files (< 100k) ...
    I understand the mechanism of the file browse and its uploading to the table WWV_FLOW_FILE_OBJECTS, but I cannot figure out why my configuration does not work when it does stricly the same but from js ...
    Someone experienced the same issue ? How to submit the upload in javascript side with doSubmit ??
    Best regards,
    Othman

    Hi Othman,
    did you find a solution for this. I'm facing nearly the same problem, I'm calling a popup, where the user can upload up to 5 files. Then on clicking a button, javascript is called, that's calling the doSubmit and some others things and at the end the popup is closed.
    Sometimes the upload of 5 files is working, sometimes only 1 file is possible (obvisiously it's depending on the filesize).
    function addFile()
    doSubmit('FILE');
    opener.actualizeProject('TAB4');
    close();
    }chrissy

Maybe you are looking for