Populating dependent dropdown without using AJAX

In my struts application, I have jsp where I have two dropdowns (<html:select>) - Course and Subject.
The values are being retrieved from database.
Now depending on the selection of my Course, I have to get corresponding Subjects from database.
If I call same Action class from jsp, when jsp loads again, it refreshes my dropdowns and the value selected previously for Course reset.
I dont want to use AJAX.
Please give some idea, how can I acheive it.
Thanks in advance.

Gagz wrote:
but when jsp loads, it clears the value of first dropdown.Ah, that's your whole problem! Populating the 2nd dropdown has completely nothing to do with it. You would still get the same problem if you didn't populate any 2nd dropdown. Try to elaborate problems the smart way the next time.
Not sure how to do it in Struts (you're here at a JSP forum, not at a Struts forum), but basically you should set the selected value based on the submitted value/property. something like <html:select value="${beanname.propertyname}"> or <html:select property="propertyname">. In plain JSP/HTML terms you just need to set the <option> to "selected" based on the submitted value as request parameter.

Similar Messages

  • Calling an On Demand Process in PL/SQL Region without using AJAX

    Hi!
    I am trying to find a way to call an On demand Process in a PL/SQL Reports Region. The reason is that i need Reportings for about 20 Pages that look like the same but have different parameters. I already have some Processes that return SQL Statements and it works fine. But these Reportings are more complex and it's not possible to return it wirh a SQL Statement.
    I have seen some solutions in this forum that used AJAX to call such a process. The problem is, that I'm not allowed to use AJAX because activeX is diabled. I tried it and it works but i need another way to solve this process call.
    Thanks in advance
    Philipp

    At the moment I cannot say if your link can help. Right now the call of the On demand Process looks like this:
    Inside annonymous PL/SQL Region:
    <script type="text/javascript">
    get = new htmldb_Get(null,'||:APP_ID||'.,'APPLICATION_PROCESS=F_REPORT_NAME',0);
    gReturn = get.get();
    document.write(gReturn);
    </script>

  • How to Use XMLHttp without using AJAX in JAVA

    Hi...
    Can any one tell me how to use XMLHttp using Java( not with AJAX or JavaScript). I have one requirement to post one Request to another vendor. that vendor is supporting XMLHttpRequest (developed in ASP). when i try to post request using HttpURLConnection connection it is giving wrong response. But when am posting same request by using VB standalone tool which is using XMLHttp which is provided by vendor it giving correct response.
    please any one tell how to use XMLHttp in JAVA

    Your code will respond to changes in selection.
    To do the same for a JButton you can do:
    JButton button = new JButton("hello world");
    button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            // say hello
    //or you could do
    button.addActionListener(al);
    ActionListener al = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            // hi
    // or use an inner, nested class that implements ActionListener
    // or an inner Action class
    button = new JButton(action);
    private Action action = new AbstractAction("mahbuhi") {
        public void actionPerformed(ActionEvent e) {
            // yes
    // or you could use an outer class that implements ActionListener...
    MyListener l = new MyListener();
    button.add(l);

  • Values having html tags not getting populated while using AJAX in APEX

    Hi,
    I am using AJAX to populate certain values in a tabular report.
    I have a java script of this form (I have taken this example from Denes's example http://apex.oracle.com/pls/otn/f?p=31517:241:1400877312570049)
    <script language="JavaScript" type="text/javascript">
    function f_set_multi_items_tabular(pValue, pRow){
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Multi_Items_Tabular',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM',pValue)
    get.add('T_ROWNUM',pRow)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM','null')
    gReturn = get.get('XML');
    if(gReturn){
    var l_Count = gReturn.getElementsByTagName("item").length;
    for(var i = 0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("item");
    var l_ID = l_Opt_Xml.getAttribute('id');
    var l_El = html_GetElement(l_ID);
    if(l_Opt_Xml.firstChild){
    var l_Value = l_Opt_Xml.firstChild.nodeValue;
    }else{
    var l_Value = '';
    if(l_El){
    if(l_El.tagName == 'INPUT'){
    l_El.value = l_Value;
    }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
    l_El.parentNode.innerHTML = l_Value;
    l_El.parentNode.id = l_ID;
    }else{
    l_El.innerHTML = l_Value;
    get = null;
    </script>
    And I have the application process as follows
    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 ('<body>');
    HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
    HTP.prn ('<item id="f05_000' || :T_ROWNUM || '">' || :TEMPORARY_APPLICATION_ITEM || '</item>');
    HTP.prn ('</body>');
    END;
    If I have :TEMPORARY_APPLICATION_ITEM as 'Vikas' it gets displayed properly but if I have '&lt;b&gt;Vikas&lt;b&gt;' it shows null. if it has any HTML tags function l_Opt_Xml.firstChild.nodeValue is not working properly .Please tell me what modiifcation can I use in function l_Opt_Xml.firstChild.nodeValue to get Values with HTML tags also to get displayed.
    Thanks,
    Vikas

    Vikas,
    Try escaping special characters: htf.escape_sc(:TEMPORARY_APPLICATION_ITEM)Regards,
    Dan

  • How to implement two dependent dropdown lists in an input  table row?

    Hi all,
    I am new in Jdev 11g. I try to develop an input table with two dependent dropdown list. I can create independent dropdown list in such table. When I try to implement dependent one following some examples do it in a form using bind variable in the view object I get an empty listbox. How can I do this? Is it possible. I cannot find any documents about this.
    Thanks in advance

    Hi,
    it hasn't changed between 10.1.3 and 11. The basic outline of how you do it is
    - use a managed bean to query the data
    - populate the list with f:selectItems that point to the managed bean ArrayList<SelectItem> for the master and the detail
    - obtain the master ID in the managed bean by parsing the #{row} variable when the table renders
    - then bulild the detail list
    - have the detail list referencing the ArrayList<SelectItem> you expose for the details
    Note that without proper caching, the action is quite expensive
    Frank

  • Using AJAX to load city, state, metro area based on zip code

    I'm new to getting APEX to work with AJAX properly. I've been reading some tutorials and trying to apply what they do to my situation, but I'm running into a problem. I have a text field item for zip code. What I want to happen is that when someone enters in a zip code, I want to use AJAX to populate 3 different select lists (1 each for state, city, and metro area) and to populate a checkbox (of neighborhoods based on the zip code as well). I'm looking at the examples in:
    http://www.oraclealchemist.com/wp-content/uploads/2006/11/s281946.pdf
    and
    http://apex.oracle.com/pls/otn/f?p=11933:63
    But they all use examples where the value of a text field item is used to populate 1 select list. I can't figure out how to apply that methodology to populate 3 select lists and 1 checkbox item. I've got all my SELECT statements written to populate these fields based on the value of the zip code text field item, but don't know how to convert what I already have to use AJAX.
    Here are my SELECT statements:
    P2805_STATE lov:
    ===========================================================================================
    SELECT INITCAP(GEO_DATA_STATE.STATEFULLNAME) d,GEO_DATA_STATE.STATE v
    FROM GEO_DATA_STATE, GEO_DATA_ZIP
    WHERE isPrimary = 'P' and
    trim(upper(GEO_DATA_ZIP.STATE)) = trim(upper(GEO_DATA_STATE.STATE)) and
    GEO_DATA_ZIP.ZIPCODE = :P2805_ZIPCODE
    ORDER BY STATEFULLNAME
    P2805_CITY lov:
    ===========================================================================================
    SELECT UNIQUE (INITCAP(GEO_DATA_CITY.CITY)) d,GEO_DATA_CITY.CITY v
    FROM GEO_DATA_STATE, GEO_DATA_ZIP, GEO_DATA_CITY
    WHERE
    trim(upper(GEO_DATA_ZIP.STATE)) = trim(upper(GEO_DATA_STATE.STATE)) and
    trim(upper(GEO_DATA_ZIP.CITY)) = trim(upper(GEO_DATA_CITY.CITY)) and
    GEO_DATA_ZIP.ZIPCODE = :P2805_ZIPCODE
    ORDER BY GEO_DATA_CITY.CITY
    P2805_METRO_AREA lov:
    ===========================================================================================
    SELECT UNIQUE (INITCAP(GEO_DATA_METRO.METRO_AREA)) d,GEO_DATA_METRO.CODE v
    FROM GEO_DATA_STATE, GEO_DATA_ZIP, GEO_DATA_METRO
    WHERE
    trim(upper(GEO_DATA_ZIP.STATE)) = trim(upper(GEO_DATA_STATE.STATE)) and
    trim(upper(GEO_DATA_ZIP.METROCODE)) = trim(upper(GEO_DATA_METRO.CODE)) and
    GEO_DATA_ZIP.ZIPCODE = :P2805_ZIPCODE
    ORDER BY 1
    P2805_NEIGHBORHOOD lov:
    ===========================================================================================
    SELECT UNIQUE (INITCAP(GEO_DATA_HOOD.HOOD)) d,GEO_DATA_HOOD.HOOD v
    FROM GEO_DATA_STATE, GEO_DATA_ZIP, GEO_DATA_METRO, GEO_DATA_HOOD
    WHERE
    trim(upper(GEO_DATA_ZIP.STATE)) = trim(upper(GEO_DATA_STATE.STATE)) and
    trim(upper(GEO_DATA_ZIP.METROCODE)) = trim(upper(GEO_DATA_METRO.CODE)) and
    GEO_DATA_HOOD.METRO_CODE = GEO_DATA_METRO.CODE and
    GEO_DATA_ZIP.ZIPCODE = :P2805_ZIPCODE
    ORDER BY 1Do all these statements need to go in 1 on-demand process? Where do I go from here?

    Andy, cool. This is starting to make more sense. THANKS A BUNCH! OK. I've gone ahead and modified the on demand process to suit my needs, so I have:
    begin
      owa_util.mime_header('text/xml', FALSE );
      htp.p('Cache-Control: no-cache');
      htp.p('Pragma: no-cache');
      owa_util.http_header_close;
      -- Building States list
      htp.prn('&lt;SELECT&gt;');
      FOR i in (
        SELECT INITCAP(GEO_DATA_STATE.STATEFULLNAME) d, GEO_DATA_STATE.STATE v
        FROM GEO_DATA_STATE, GEO_DATA_ZIP
        WHERE isPrimary = 'P' and
        trim(upper(GEO_DATA_ZIP.STATE)) = trim(upper(GEO_DATA_STATE.STATE)) and
        GEO_DATA_ZIP.ZIPCODE = :P2805_ZIPCODE
        ORDER BY STATEFULLNAME
      LOOP
        htp.prn('&lt;OPTION VALUE=''' || i.v || '''&gt;' || i.d || '&lt;/OPTION&gt;');
      END LOOP;
      htp.prn('&lt;/SELECT&gt;');
      -- Building Cities list
      htp.prn('&lt;SELECT&gt;');
      FOR i in (
        SELECT UNIQUE (INITCAP(GEO_DATA_CITY.CITY)) d, GEO_DATA_CITY.CITY v
        FROM GEO_DATA_STATE, GEO_DATA_ZIP, GEO_DATA_CITY
        WHERE
        trim(upper(GEO_DATA_ZIP.STATE)) = trim(upper(GEO_DATA_STATE.STATE)) and
        trim(upper(GEO_DATA_ZIP.CITY)) = trim(upper(GEO_DATA_CITY.CITY)) and
        GEO_DATA_ZIP.ZIPCODE = :P2805_ZIPCODE
        ORDER BY GEO_DATA_CITY.CITY
      LOOP
        htp.prn('&lt;OPTION VALUE=''' || i.v || '''&gt;' || i.d || '&lt;/OPTION&gt;');
      END LOOP;
      htp.prn('&lt;/SELECT&gt;');
      -- Building Metro Area list
      htp.prn('&lt;SELECT&gt;');
      FOR i in (
        SELECT UNIQUE (INITCAP(GEO_DATA_METRO.METRO_AREA)) d, GEO_DATA_METRO.CODE v
        FROM GEO_DATA_STATE, GEO_DATA_ZIP, GEO_DATA_METRO
        WHERE
        trim(upper(GEO_DATA_ZIP.STATE)) = trim(upper(GEO_DATA_STATE.STATE)) and
        trim(upper(GEO_DATA_ZIP.METROCODE)) = trim(upper(GEO_DATA_METRO.CODE)) and
        GEO_DATA_ZIP.ZIPCODE = :P2805_ZIPCODE
        ORDER BY 1
      LOOP
        htp.prn('&lt;OPTION VALUE=''' || i.v || '''&gt;' || i.d || '&lt;/OPTION&gt;');
      END LOOP;
      htp.prn('&lt;/SELECT&gt;');
      -- Building Neighborhood list
      htp.prn('&lt;SELECT&gt;');
      FOR i in (
        SELECT UNIQUE (INITCAP(GEO_DATA_HOOD.HOOD)) d, GEO_DATA_HOOD.HOOD v
        FROM GEO_DATA_STATE, GEO_DATA_ZIP, GEO_DATA_METRO, GEO_DATA_HOOD
        WHERE
        trim(upper(GEO_DATA_ZIP.STATE)) = trim(upper(GEO_DATA_STATE.STATE)) and
        trim(upper(GEO_DATA_ZIP.METROCODE)) = trim(upper(GEO_DATA_METRO.CODE)) and
        GEO_DATA_HOOD.METRO_CODE = GEO_DATA_METRO.CODE and
        GEO_DATA_ZIP.ZIPCODE = :P2805_ZIPCODE
        ORDER BY 1
      LOOP
        htp.prn('&lt;OPTION VALUE=''' || i.v || '''&gt;' || i.d || '&lt;/OPTION&gt;');
      END LOOP;
      htp.prn('&lt;/SELECT&gt;');
    end;It doesn't look like I would have to modify the appendToSelect function at all, correct? Is the checkbox that I need to populate handled the same way as these select lists? And it seems like I only need to make the 2 changes that you mentioned to get_AJAX_SELECT_XML function, right? So my javascript function should be like:
    &lt;script language="JavaScript1.1" type="text/javascript"&gt;
    function get_AJAX_SELECT_XML(pThis,pSelect1,pSelect2,pSelect3,pSelect4){
    if  (document.getElementById('P2805_ZIPCODE').value.length == 5)
         var l_Return = null;
         var l_Select1 = $x(pSelect1);
         var l_Select2 = $x(pSelect2);
         var l_Select3 = $x(pSelect3);
         var l_Select4 = $x(pSelect4);
         var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=otn_Select_XML',0);
         get.add('TEMPORARY_ITEM',pThis.value);
         gReturn = get.get('XML');
         var sels = gReturn.getElementsByTagName("select");
         if(gReturn && l_Select1){
              var l_Count = sels[0].getElementsByTagName("option").length;
              l_Select1.length = 0;
              for(var i=0;i<l_Count;i++){
                   var l_Opt_Xml = sels[0].getElementsByTagName("option");
                   appendToSelect(l_Select1, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
         if(gReturn && l_Select2){
              var l_Count = sels[1].getElementsByTagName("option").length;
              l_Select2.length = 0;
              for(var i=0;i<l_Count;i++){
                   var l_Opt_Xml = sels[1].getElementsByTagName("option")[i];
                   appendToSelect(l_Select2, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
         if(gReturn && l_Select3){
              var l_Count = sels[2].getElementsByTagName("option").length;
              l_Select3.length = 0;
              for(var i=0;i<l_Count;i++){
                   var l_Opt_Xml = sels[2].getElementsByTagName("option")[i];
                   appendToSelect(l_Select3, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
         if(gReturn && l_Select4){
              var l_Count = sels[3].getElementsByTagName("option").length;
              l_Select4.length = 0;
              for(var i=0;i<l_Count;i++){
                   var l_Opt_Xml = sels[3].getElementsByTagName("option")[i];
                   appendToSelect(l_Select4, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
         get = null;
    &lt;/script&gt;
    And then since all 4 items (3 select lists and 1 checkbox item) are populated based on the value inputted in the text field item, I would only need to add the following to the html form element attribute of my text field item, right?
    onKeyUp="javascript:get_AJAX_SELECT_XML(this,'P2805_STATE','P2805_CITY','P2805_METRO_AREA','P2805_NEIGHBORHOOD');"Denes, thanks for the example. It seems like what I need to do is somewhere inbetween what you have and what's in the example on http://apex.oracle.com/pls/otn/f?p=11933:37. I have 3 select lists and 1 checkbox item that should all be populate depending on the value entered for the text item. Do I still need to split everything up then into a function and an on demand process for each select list and checkbox?

  • How to use Ajax Get Multiple Values in Tabular form?

    Hi All-
    I am trying to use AJAX to get multiple values in tabular form by using Denes Kubicek's example in the following link -
    http://apex.oracle.com/pls/otn/f?p=31517:239:9172467565606::NO:::
    Basically, I want to use the drop down list to populate rest of the values on the form.
    I have created the example(Ajax Get Multiple Values, application 54522) on Oracle site -
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    Workspace: iConnect
    login: demo
    password: demo
    I was able to duplicate his example on page 1 (home page).
    However, I want to use system generate tabular form to finish this example, and was not able to populate the data correctly.
    Page 2 (method 2) is the one that I am having trouble to populate the column values. When I checked application item values in Session, and the values seems to be populated correctly.
    This is what I have done on this page:
    1. Create an Application Process On Demand - Set_Multi_Items_Tabular2:
    DECLARE
      v_subject my_book_store.subject%TYPE;
      v_price my_book_store.price%TYPE;
      v_author my_book_store.author%TYPE;
      v_qty NUMBER;
      CURSOR cur_c
      IS
      SELECT subject, price, author, 1 qty
      FROM my_book_store
      WHERE book_id = :temporary_application_item2;
    BEGIN
      FOR c IN cur_c
      LOOP
      v_subject := c.subject;
      v_price := c.price;
      v_author := c.author;
      v_qty := c.qty;
      END LOOP;
      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 ('<body>');
      HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
      HTP.prn ('<item id="f04_' || :t_rownum || '">' || v_subject || '</item>');
      HTP.prn ('<item id="f05_' || :t_rownum || '">' || v_price || '</item>');
      HTP.prn ('<item id="f06_' || :t_rownum || '">' || v_author || '</item>');
      HTP.prn ('<item id="f07_' || :t_rownum || '">' || v_qty || '</item>');
      HTP.prn ('</body>');
    END;
    2. Create two application items - TEMPORARY_APPLICATION_ITEM2, T_ROWNUM2
    3. Put the following in the Page Header:
    <script language="JavaScript" type="text/javascript">
    function f_set_multi_items_tabular2(pValue, pRow){
        var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Multi_Items_Tabular2',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM2',pValue)
    get.add('T_ROWNUM2',pRow)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM2','null')
        gReturn = get.get('XML');
        if(gReturn){
            var l_Count = gReturn.getElementsByTagName("item").length;
            for(var i = 0;i<l_Count;i++){
                var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
                var l_ID = l_Opt_Xml.getAttribute('id');
                var l_El = html_GetElement(l_ID);   
                if(l_Opt_Xml.firstChild){
                    var l_Value = l_Opt_Xml.firstChild.nodeValue;
                }else{
                    var l_Value = '';
                if(l_El){
                    if(l_El.tagName == 'INPUT'){
                        l_El.value = l_Value;
                    }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
                        l_El.parentNode.innerHTML = l_Value;
                        l_El.parentNode.id = l_ID;
                    }else{
                        l_El.innerHTML = l_Value;
        get = null;
    </script>
    Add the follwing to the end of the above JavaScript:
    <script language="JavaScript" type="text/javascript">
    function setLOV(filter, list2)
    var s = filter.id;
    var item = s.substring(3,8);
    var field2 = list2 + item;
    f_set_multi_items_tabular2(filter, field2);
    4. Tabular form query:
    select
    "BOOK_ID",
    "BOOK",
    "SUBJECT",
    "PRICE",
    "AUTHOR",
    "QTY",
    "BOOK_ID" BOOK_ID_DISPLAY
    from "#OWNER#"."MY_BOOK_STORE"
    5. In Book_ID_DISPLAY column attribute:
    Add the following code to element attributes: onchange="javascript:f_set_multi_items_tabular2(this.value,'#ROWNUM#');"
    Changed to -> onchange="javascript:setLOV(this,'f03');"
    Now,  T_ROWNUM2 returns value as f03_0001. But, TEMPORARY_APPLICATION_ITEM2 returns as [object HTMLSelectElement]...
    Please help me to see how I can populate the data with this tabular form format. Thanks a lot in advanced!!!
    Ling
    Updated code in Red..

    Ling
    Lets start with looking at what the javascript code is doing.
    function f_set_multi_items_tabular(pValue, pRow){
      /*This will initiate the url for the demand process to run*/
      var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
                              'APPLICATION_PROCESS=Set_Multi_Items_Tabular',0);
      if(pValue){
        /*If there is an value than submit item name with value*/
        get.add('TEMPORARY_APPLICATION_ITEM',pValue)
        get.add('T_ROWNUM',pRow)
      }else{
        /*Else set the item TEMPORARY_APPLICATION_ITEM to null*/
        get.add('TEMPORARY_APPLICATION_ITEM','null')
      /*Submit the url and te returned document is of type XML*/
      gReturn = get.get('XML');
      if(gReturn){
        /*There is something returned*/
        var l_Count = gReturn.getElementsByTagName("item").length;
        /*For all elements of the tag item*/
        for(var i = 0;i<l_Count;i++){
          /*Get the item out of the XML*/
          var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
          /*Get the id of the item*/
          var l_ID = l_Opt_Xml.getAttribute('id');
          /*Get the element in the original page with the same id as
          **the item we have in the XML produced by the ondemand process
          var l_El = html_GetElement(l_ID);
          /*Now get the value of the item form the XML*/
          if(l_Opt_Xml.firstChild){
            var l_Value = l_Opt_Xml.firstChild.nodeValue;
          }else{
            /*There is no value*/
            var l_Value = '';
          if(l_El){
            /*There is an element with the same id as the item we are processing*/
            if(l_El.tagName == 'INPUT'){
              /*The element is an input item just set the value*/
              l_El.value = l_Value;
            }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
              /*If it is a span elment and has the class grabber
              **Then set the innerHTML of the parent to the value
              **and the id of the parent to the id
              l_El.parentNode.innerHTML = l_Value;
              l_El.parentNode.id = l_ID;
            }else{
              /*Else set the value as innerHTML*/
              l_El.innerHTML = l_Value;
      get = null;
    Now where it went wrong in your initial post
    The XML that was returned by your XML process would be something like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_1">CSS Mastery</item>
      <item id="f03_1">22</item>
      <item id="f04_1">Andy Budd</item>
      <item id="f05_1">1</item>
    </body>
    When you don't use apex_item to create your tabular form a item in the table will look like
    <input id="f02_0001" type="text" value="CSS Mastery" maxlength="2000" size="16" name="f05" autocomplete="off">
    Notice the id's f02_1 and f02_0001 don't match.
    So to make it work the XML would have to look like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_0001">CSS Mastery</item>
      <item id="f03_0001">22</item>
      <item id="f04_0001">Andy Budd</item>
      <item id="f05_0001">1</item>
    </body>
    To do that simply use lpad in the ondemand process like
    HTP.prn ('<item id="f02_' || lpad(:t_rownum,4,'0') || '">' || v_subject || '</item>');
    HTP.prn ('<item id="f03_' || lpad(:t_rownum,4,'0') || '">' || v_price || '</item>');
    HTP.prn ('<item id="f04_' || lpad(:t_rownum,4,'0') || '">' || v_author || '</item>');
    HTP.prn ('<item id="f05_' || lpad(:t_rownum,4,'0') || '">' || v_qty || '</item>');
    Keep in mind that the above is based on your original post and #ROWNUM# not being lpadded with zero's.
    Nicolette

  • HT1689 How can I play podcasts on my iphone without using data?

    How can I play podcasts on my iphone without using data?

    I used to sync my podcasts to my phone individually, but found out that the Podcast app works better for me.  It continously downloads the podcasts (not really sure when, that's the only thing, when its downloading it may use data depending on where you are) and also deletes the ones i have listened to.  Hopefully that will help you out!

  • How can I create a new entry without using LOV for foreign keys.

    Referring to TUHRA sample application based on HR database schema. JDeveloper 10.1.3.0.4
    How can I create a new employee without using LOV for the foreign key "job_id".
    On the first page I would like to choose the job_title from adf read-only table.
    After clicking on the "create new employee button" a creation form appears in which the job_id field is set with previous selection.
    Regards M.Winkler
    Edited by: user3541283 on 06.10.2008 03:44
    Edited by: user3541283 on 06.10.2008 03:50

    Hi,
    usually the foreign key is only set if the VO you select is dependent from a master. If e.g. you have DepartmentsVO1 that has an EmployeeVO3 as its nested VO, then creating a new instance of employees automatically add the foreign key. If you add EmployeesVO1, which is not dependent to DepartmensVO1, then the foreign key is not set. So if this is the case in THURA (keep in mind that this is not an Oracle demo but a sample used in a book about ADF) then all you need is to take the independent VO when building the new employee form.
    Frank

  • How to create a viewobject dynamically without using wizard

    Hi,
    I am Using jDEV 11G, i need to create a viewobject dynamically without using wizard, without binding from any entity.
    Actually my intention is to make a grid like in .Net, when a user want to create a new row in RichTable without using DB.
    just like shopping cart.
    i have done thsi code:
    ViewObjectImpl view=new ViewObjectImpl();
    view.addDynamicAttributeWithType("Att1","String",null);
    view.addDynamicAttributeWithType("Att2","String",null);
    view.addDynamicAttributeWithType("Att2","String",null);
    Row rw=view.createRow();
    rw.setAttribute("Att1","First1");
    rw.setAttribute("Att2","First2");
    rw.setAttribute("Att2","First3");
    view.insertRow(rw);
    I have a RichTable , i need bind this viewobject into that.
    Edited by: vipin k raghav on Mar 10, 2009 11:39 PM

    Hi Vipin,
    You can create the view object with rows populated at run time.
    [http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcquerying.htm#CEGCGFCA]
    For reference of how to create an empty rwo at run time on button click
    [http://kohlivikram.blogspot.com/2008/10/add-new-row-in-adf-table-on-button.html]
    ~Vikram

  • Uploading a file to server using ajax and struts

    My problem is i wrote a program to upload a file to the server using Ajax.
    Here iam used Struts and Ajax.
    The problem is when iam uploaded a file from my PC the file is uploading to the server in the upload folder located in the server my system.
    Iam using Tomcat server 5.0
    But when iam trying to access it through other system it is not doing so
    Giving an internal server error i,e 500.
    Iam putting the necessary documents for ur reference.
    Plz help me soon .
    My exact requirement is i have to upload a file to the upload folder located in the server.
    And i have to get the path of that file and display the file path exactly below the browse button from where iam uploaded a file.
    That should be done without page refresh and submit thats y iam used Ajax
    Any help would greatly appreciated
    Thanks and Regards
    Meerasaaheb.
    The action class is FilePathAction
    package actions;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.*;
    public class FilePathAction extends Action{
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    String contextPath1 = "";
    String uploadDirName="";
    String filepath="";
    System.out.println(contextPath1 );
    String inputfile = request.getParameter("filepath");
    uploadDirName = getServlet().getServletContext().getRealPath("/upload");
    File f=new File(inputfile);
    FileInputStream fis=null;
    FileOutputStream fo=null;
    File f1=new File(uploadDirName+"/"+f.getName());
    fis=new FileInputStream(f);
    fo=new FileOutputStream(f1);
    try
    byte buf[] = new byte[1024*8]; /* declare a 8kB buffer */
    int len = -1;
    while((len = fis.read(buf)) != -1)
    fo.write(buf, 0, len);
    catch(Exception e)
    e.printStackTrace();
    filepath=f1.getAbsolutePath();
    request.setAttribute("filepath", filepath);
    return mapping.findForward("filepath");
    the input jsp is
    filename.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    <script type="text/javascript">
    alertflag = false;
    var xmlHttp;
    function startRequest()
    if(alertflag)
    alert("meera");
    xmlHttp=createXmlHttpRequest();
    var inputfile=document.getElementById("filepath").value;
    xmlHttp.open("POST","FilePathAction.do",true);
    xmlHttp.onreadystatechange=handleStateChange;
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttp.send("filepath="+inputfile);
    function createXmlHttpRequest()
    //For IE
    if(window.ActiveXObject)
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    //otherthan IE
    else if(window.XMLHttpRequest)
    xmlHttp=new XMLHttpRequest();
    return xmlHttp;
    //Next is the function that sets up the communication with the server.
    //This function also registers the callback handler, which is handleStateChange. Next is the code for the handler.
    function handleStateChange()
    var message=" ";
    if(xmlHttp.readyState==4)
    if(alertflag)
    alert(xmlHttp.status);
    if(xmlHttp.status==200)
    if(alertflag)
    alert("here");
    document.getElementById("div1").style.visibility = "visible";
    var results=xmlHttp.responseText;
    document.getElementById('div1').innerHTML = results;
    else
    alert("Error loading page"+xmlHttp.status+":"+xmlHttp.statusText);
    </script></head><body><form name="thumbs" enctype="multipart/form-data" method="post" action="">
    <input type="file" name="filepath" id="filepath" onchange="startRequest();"/>
    </form>
    <div id="div1" style="visibility:hidden;">
    </div></body></html>
    The ajax response is catching in a dummy.jsp
    <%=(String)request.getAttribute("filepath")%>
    corresponding action mapping
    <action path="/FilePathAction" type="actions.FilePathAction">
    <forward name="filepath" path="/dummy.jsp"/>
    </action>
    So plz help me to upload a file to the server from any PC.
    Iam searched alot but didnt get any solution.

    Plz help me soon if it possible so
    Iam in great need.
    I have worked alot but not worked out.
    Any help greatly appreciated

  • Solved: ADF BC and primary keys - how to implement without using triggers

    Using the following OBE as an example:
    http://www.oracle.com/technology/obe/obe9051jdev/ADFWorkshop/BuildingADFApplicationsWorkshop.htm
    There is just one view that has CustomerId defined as a primary key, where the value for the primary key comes from the customer_seq sequence.
    How do you create the model using ADF BC entity to create an entity object that has a primary key that needs to be populated by a sequence table when inserted WITHOUT using a trigger?
    Basically I want to just use ADF BC instead of toplink in the OBE. We do not use triggers to insert primary keys, so this example is a good match for what I need.
    Can someone help me out. How do I adjust the model to use just ADF BC - how do I define the entity object to use a sequence. Do I just override the create method in the impl? Is it that simple? Or is there a way to do this point and click in the entity tool.
    Thanks!

    I'm not the dba (or one of several) - so don't shoot the messenger... the dba's do not like to use triggers in the code. I have been told that this has caused too many problems in application development.
    I don't ask why, just deal with the fallout.
    I did try using the following code in a create method:
    protected void create(AttributeList attributeList)
    super.create(attributeList);
    SequenceImpl s = new SequenceImpl("customers_seq", getDBTransaction());
    // this.setCustId(s.getSequenceNumber());
    this.createPrimaryKey(s.getSequenceNumber());
    When I run the test program for the module, I get a new entry with the id empty and greyed out. I was hoping that this would be filled in on the actual insert, but no joy. As soon as I try to commit, I get an error:
    (oracle.jbo.AttrValException) JBO-27014: Attribute CustId in CustomersWSView is required)
    So what needs to be done?
    Message was edited by:
    klee

  • Message Spiltting Without Using BPM in XI-7.0

    We are using XI-7.0.
    We need to spilt the message from 1 to many without using BPM based on following conditions.
    We need to spilt the one message in many messages depending on the segment records of ZORDER3 and ZORDER2.
    If IDOC message do not have segment ZORDER3 then message needs to be spilt based on the segment records of ZORDER2.
    In the following example, one IDOC message would come from SAP system and that message needs to spilt into 7 messages for the vendor's system.
    Any help will be appreciated.
    <u>Source message: IDOC-ZORDER</u>
    <i>Segment:ZORDER1(Max occ-1)
    PO:4600000010
    LineItem:00010
    Plant:5000
               Segment:ZORDER2(Max occ-999)
               ServiceCode-100000
                              Segment:ZORDER3(Max occ-99)
                              CostCenter:CC123456789
                              CostDesc:CCTest1
                              CocstCenter:CC23456795
                              CostDesc:CCTest2
                               WBSElement:WBS45698712
                               CostDesc:WBSTest1
                               WOrderNo:WO56987412
                               CostDesc:WOTest1
              ServiceCode-200000
                              Segment:ZORDER3(Max occ-99)
                              CocstCenter:CC78956795
                              CostDesc:CCTest7
                               WBSElement:WBS492871
                               CostDesc:WBSTest5
                               WOrderNo:WO98757412
                               CostDesc:WOTest6
    <u>Target Message Structure</u>
    POData(1:1)
              Level1(1:1)
              PO&LineItemNo:460000001000010
              Plant:5000
              ServiceCode-100000
              Level2(1:1)
              costobjectID:CC123456789
              costobjectDesc:CCTest1</i>Thanks in advance!
    MP

    Mrudula,
    If you give the target structure and occurrences of it , then it will be more helpful. Also please quote on wht basis the message needs to be splitted, coz the condition is not clear, Please give the condition too.
    Best regards,
    raj.

  • I want to create an internal table without using header line and occurs 0?

    hi experts,
    Can anybody help me to declare an internal table without using headerline and occurs 0 options but still i have to use the functionalities that occurs 0 and header line options provide.

    Hi Saisri,
    You can use the internal table without headerline and create a header for then internal table with the same structure. We need to use the header while manipulating with the data of the internal table.
    example:
    types: begin of ty_afpo,
                 kdauf type kdauf,
                 kdpos type kdpos,
                 ltrmp   type ltrmp,
               end   of ty_afpo.
    data : t_afpo type standard table of ty_afpo,  " internal table declaration
             wa_afpo type ty_afpo.                        " work area declaration
    <after populating the data into the internal table>
    loop at t_afpo into wa_afpo.
    write:/ wa_afpo-kdauf, wa_afpo-kdpos, wa_afpo-ltrmp.
    endloop.
    This I think shall give you a basic understanding of how things work.
    <b>Reward points if this helps,</b>
    Kiran

  • Saving a Text data to a PDF file without using print option

    Hi,
    I want to save a Text to a PDF file. I want to assign the path of the PDF file as a default one.
    If I use Print options, then it ask for the file path at the run time.
    Is there any method to save to a PDF file without using print option in Labview 8.2.
    Regards,
    Raja

    This question comes up a lot. Did you try searching? It depends on the PDF printer driver that you're using. See here, here, here, ...

Maybe you are looking for