Storing SELECT list definition after AJAX call

Hi all
I redefine the options in the SELECT item via AJAX call. The application process returns string similar to <option>x1</option><option>x2</option>, which is set as SELECT item innerHTML content. Everything works fine.
The problem is that I need to switch to another page and than return back. The original page is re-rendered and the redefinition of the SELECT item options is obviously lost.
Any recommentation how to solve it simply and robustly?
Thanks
Roman

I think i should do a Modal window, like described there:
http://oracleapexbynandinithakur.blogspot.com/2011/02/modal-form-in-apex.html
And after inserting a new record in Modal window user closes the Modal window with a button there, and i somehow then repopulate the underlying page's Select List component.

Similar Messages

  • Report with select list and link to call another report

    Hi,
    I am trying to do 2 reports (REPORT1 and REPORT2).
    The first is a summary report (REPORT1).
    This report will display sales figures for the year. Now, I need to have a select list in the result set that will have 2 options, depending on which option is chosen, I want to call REPORT2 with the select list as a parameter. How can I do this ?
    Let me try to explain what I did.
    I created REPORT1 on Page 100
    SELECT YEAR, sum(YTD_SALES), APEX_ITEM.SELECT_LIST(1,'DEPARTMENT','Department;DEPARTMENT,Division;DIVISION') Drilldown FROM SALES_ANALYSIS WHERE YEAR > 2000
    GROUP BY YEAR ORDER BY YEAR
    I created 2 hidden items namely P100_YEAR and P100_DRILLDOWN
    I also made the column YEAR as a link and specified both P100_YEAR and P100_DRILLDOWN as parameters to be passed.
    Next, I created REPORT2
    SELECT YEAR, DECODE(:P100_DRILLDOWN, 'Department', department, 'Division', Division) dept_div, sum(YTD_SALES) ytd_sales
    FROM SALES_ANALYSIS
    WHERE YEAR = :P100_YEAR
    When I run Report 1, it's fine, when I choose either Department or Division from the Select List and click on the link to call Report 2, report 2 is displayed, but the value being passed for P100_DRILLDOWN is not correct and as a result, I am unable to get correct results for Report 2
    Am I missing something ? Are there any alternate ways to do what I'm doing ?
    Thanks,
    Ashok

    Hi Ashok,
    The link definition will not know the value selected in the list as it is constructed only when the page is being rendered. You would need to create some javascript to handle this. I've done that here: [http://apex.oracle.com/pls/otn/f?p=267:182]
    The link on the EMPNO column has been defined in the HTML Expression setting for the column instead of the Link section. The HTML Expression that I have used is:
    &lt;a href="#" onclick="javascript:doDrilldown('#EMPNO#',this);"&gt;#EMPNO#&lt;/a&gt;And, in the page's HTML Header setting, I have added in:
    &lt;script type="text/javascript"&gt;
    function doDrilldown(empno,group)
    var g;
    var p = group.parentNode;
    while (p.tagName != "TR")
      p = p.parentNode;
    var x = p.getElementsByTagName("SELECT");
    if (x.length &gt; 0)
      g = x[0].value;
    var url = "f?p=&APP_ID.:183:&SESSION.::::P183_EMPNO,P183_GROUP:" + empno + "," + g;
    document.location.href = url;
    &lt;/script&gt;When a link is clicked, the doDrilldown function is called passing in the EMPNO value and the "this" object (which identifies the object triggering the call). The function starts from that object and goes up in the HTML tag tree to the nearest TR tag (the row tag that the link is on) and then finds the first SELECT list item on the row and gets its value. It then constructs a URL using this and the EMPNO value and performs a redirect to the second page (page 183 in this example).
    Andy

  • Getting 'variable not in select list' error after extending VO

    Hi,
    My page is based on two VO. one VO has all transient attribute(LearnerSearchCritVO) and used to capture Search Criteria, The other VO is used for query(LearnerSearchVO).
    I have exteneded LearnerSearchCritVO to add 4 new additional Transient attributes
    and LearnerSerachVO and its IMPL class to add additional where clause.
    After substitution and personalization when I am querying through page I am getting the following error -
    ## Detail 0 ##
    java.sql.SQLException: ORA-01007: variable not in select list
    The query is working fine at backend and the same thing was working fine before instance is refreshed.
    I am not able to find why this error is coming.
    please help me out to sort this issue.

    Hi All
    Sorry to bring this one up again, but I've had a bit of a look around and done as much as I can based on the information given in this and other threads on the subject.
    I'm getting the java.sql.SQLException: ORA-01007: variable not in select list error from my extended VO/substitution.
    The query is based on a view for easy editing after deployment, so could that have anything to do with it?
    Here's the query from the error message:
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement:
    SELECT * FROM (SELECT
    SSH.FULL_NAME,
    SSH.ASSIGNMENT_NUMBER,
    SSH.JOB,
    SSH.GRADE,
    SSH.ANNUALIZED_SALARY,
    SSH.CURRENCY,
    SSH.CHANGE_DATE,
    SSH.SALARY_BASIS,
    SSH.PERSON_ID,
    SSH.ASSIGNMENT_ID,
    SSH.SUPERVISOR_ID,
    SSH.LAST_CHANGE_DATE,
    SSH.PAYROLL_NAME,
    SSH.NEXT_CHANGE_DATE,
    SSH.EMPLOYEE_NUMBER,
    SSH.CWK_NUMBER,
    SSH.PERSON_TYPE,
    SSH.EFFECTIVE_DATE,
    SSH.SUPERVISOR_ASSIGNMENT_ID,
    SSH.LEGISLATIONCODE,
    SSH.MANAGER_ENABLED
    FROM XX_SAL_SUP_HRCHY_VO_V SSH) QRSLT
    WHERE (((:1 = SUPERVISOR_ID)
    AND (:2 = EFFECTIVE_DATE)
    AND (:3 = SUPERVISOR_ASSIGNMENT_ID
    OR hr_general2.supervisor_assignments_in_use = 'FALSE')))
    ORDER BY FULL_NAME
    So... What's missing?
    Any help appreciated.
    CK

  • Java webapge content reading after ajax call execution

    Hi ,
    Is there any way in java to read the contents of a webpage.
    Webpage is not a simple html page , it contais ajax call , image ,pdf & flash.
    I need to read / download all the contents of the page after the ajax call also executed.
    Please suggest me any solution for this
    Regards
    Vinod

    975512 wrote:
    Hi ,
    Is there any way in java to read the contents of a webpage.
    Webpage is not a simple html page , it contais ajax call , image ,pdf & flash.
    I need to read / download all the contents of the page after the ajax call also executed.
    Please suggest me any solution for this
    Regards
    VinodYou can try looking at using a selenium test driver (http://seleniumhq.org/docs/03_webdriver.html#introducing-the-selenium-webdriver-api-by-example) using a headless browser.

  • Javascript error in IE after re-generating select list

    Hi,
    I have 2 select lists (Apex 4 cascading select list; the second one is driven by the first one) in a form. I use jQuery modal dialog to show a hidden item to allow users to add new values to the second select list. After that, I use the following JavaScripts to re-generate the options in the second select list. Somehow, in IE, it re-generates the options but shows error after that. It looks like the error complains somewhere after the options have been re-generated.
    Does anyone have any idea about how to force a select list to refresh (or any jQuery/Apex API) - without submitting the form?
    Thanks.
    Andy
    <pre>
    function addDesc()
    var ajaxRequest = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=ADD_EXP_CATEGORY_SUB', 0);
    ajaxRequest.add('P5_MODALFORM_CAT_SUB', $v('P5_MODALFORM_CAT_SUB'));
    ajaxRequest.add('P5_INV_EXP_CATEGORY_PK', $v('P5_INV_EXP_CATEGORY_PK'));
    var gReturn = ajaxRequest.get();
    if (gReturn) {
    if (gReturn > 0) {
    closeForm();
    // reload description select list
    reload_exp_cat_sub('P5_INV_EXP_CATEGORY_SUB_PK',gReturn);
    } else {
    alert('Error inserting category sub');
    } else {
    alert('Error inserting category sub');
    ajaxRequest = null;
    function reload_exp_cat_sub(pSelect,pReturn){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,&APP_ID.,
    'APPLICATION_PROCESS=RELOAD_EXP_CAT_SUB',0);
    gReturn = get.get('XML');
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    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)
    // Select the new value just inserted
    html_SetSelectValue(l_Select,pReturn);
    get = null;
    function appendToSelect(pSelect, pValue, pContent) {
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    </pre>

    Hello Ellie,
    I see the same behavior and I'm looking into it. Thanks for
    your patience.
    Best regards,
    Corey

  • Slight AJAX select list issue, hopefully....

    I have probably looked at every example that uses AJAX to populate select lists that is out there and finally got one almost completely working.
    In my app I use a Form on page 23 to create a record and then also use a form on page 22 to update a record. On both of these pages i have 2 select lists that use AJAX to populate each other. On my Create Form page, these two select lists display properly and submit properly to a report page.
    Now, when i click on that record that i just created from the report page, i am taken to the update page(page 22) where all items that i just submitted are properly displayed except the second select list. The second select list does display the correct list of items within the select list, just not the one that i had just selected. What is being displayed is the very first option in the select list, no matter what i had selected when i created the record. What in my code would always make the first option display no matter what?
    Thanks
    Deanna
    For example:
    My current ouput:
    Pg.23(Creating the record)
    Parameters:
    :P23_CASE_NUMBER--------------------------9999999999
    :P23_CONT_FACTOR_CATEG--------------Driver Distracted By
    :P23_CAUSES-----------------------------------Other Electronic Devices
    Pg.22(Updating the record)
    Parameters:
    :P22_CASE_NUMBER--------------------------9999999999
    :P22_CONT_FACTOR_CATEG--------------Driver Distracted By
    :P22_CAUSES-----------------------------------Mobile(cell)phone(WRONG)(First option in list)
    Output I should see:
    Pg.23(Creating the record)
    Parameters:
    :P23_CASE_NUMBER--------------------------9999999999
    :P23_CONT_FACTOR_CATEG--------------Driver Distracted By
    :P23_CAUSES-----------------------------------Other Electronic Devices
    Pg.22(Updating the record)
    Parameters:
    :P22_CASE_NUMBER--------------------------9999999999
    :P22_CONT_FACTOR_CATEG--------------Driver Distracted By
    :P22_CAUSES-----------------------------------Other Electronic Devices(CORRECT)
    Current code from page 22(Update Page):
    This is from the Header HTML
    <script language="JavaScript1.1" type="text/javascript">
    function get_TASK_SELECT_XML(pThis,pSelect){
    var l_Return = null;
    var l_Select = $x(pSelect);
    var get = new htmldb_Get(null,$x('pFlowId').value,
    'APPLICATION_PROCESS=TaskXML',0);
    get.add('WORK',pThis.value);
    gReturn = get.get();
    gReturn = get.get('XML');
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    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){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    </script>
    This is the application process - TaskXML
    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>');
    htp.prn('<option value="' || -1 || '">' || ' - Select-' || '</option>');
    for rec in (select cause , cause
    from cause where categ = :WORK)
    loop
    htp.prn('<option value="' || rec.cause_number || '">' || rec.cause || '</option>');
    end loop;
    htp.prn('</select>');
    end;

    Hello Deanna,
    Is the "select cause, cause" statement a typo?
    for rec in (select cause , cause
                  from cause where categ = :WORK)
    loop
       htp.prn('<option value="' || rec.cause_number || '">' || rec.cause || '</option>');
    end loop;
    htp.prn('</select>');
    end;If not, the list you're seeing could possibly be the result of the LOV defined for P22_CAUSES, assuming there is one.
    - Alwyn

  • Select list that is dependent on another select list with ajax

    I have a select list that contains it (ajax)
    onchange = "get_select_list_ajax (this, 'P2012_REQUERENTE', 'COMBO_REQUERENTE_ITEM', 'COMBO_REQUERENTE_AJAX');" class = "largura200"
    So I have a select list below, which is conditional, according to the value returned from the select list P2012_Cliente.
    DECLARE
    v_tipo VARCHAR2 (50);
    BEGIN
    SELECT DISTINCT (id_cliente_tipo) INTO v_tipo FROM vw_cliente
    WHERE customer_id =: P2012_CLIENTE;
    IF (v_tipo = pkg_cfg.c_tp_cliente_interno) THEN
    RETURN true;
    ELSE
    RETURN false;
    END IF;
    EXCEPTION WHEN OTHERS THEN
    NULL;
    END;
    But is not working .. Why? He is not detecting the return of the select list that is Ajax?

    How can I send the return of a select list (ajax) on a text item?
    html_form_attributes of sel. list -> onchange = "get_select_list_ajax (this, 'P2012_REQUERENTE', 'COMBO_REQUERENTE_ITEM', 'COMBO_REQUERENTE_AJAX');" class = "largura200"

  • How to send other parateters with the ajax call for rich:suggestion ...

    Hi
    For the component <rich:suggestion ...>
    How I can send parameters (besides what user fills in a field ) for the method
    public List fetchAjaxList(Object event) wich is called when the user changes the content of the input field.
    Put it in another way, I need values for two drop down lists that the user selects on the same page, this is because the returned list of the Ajax call DOES NOT depened only on the value of the input text field.
    Thanks

    Sorry, we are not writing AJAX like code. In conjunction with drop downs we are using the command "Autosubmit On Change" in the Design View of a NetBeans Visual JSF project. Than the IDE generates code like
    onChange="common_timeoutSubmitForm(this.form, 'tabSetAngebotsauswahl:tabAngebotsauswahl:layoutPanelAngebotsauswahl:gridPanelAngebotsauswahl:dropDownAuftraggeber');"  in the JSP. The whole page will be refreshed by a normal form submit than.

  • How to get the text boxes and select lists dynamically?

    Hi,
    I have a requirement such that I need to create the text boxes and select lists depending on the user input at the run time. It means that if the user requires four text boxes/select lists then I need to have 4 such thing. If the user need 6 then I need to have 6.
    The design may be such that initially only one text box/select list will be available when the page launches. Then as ad when the user asks for more those will be available to the user accordingly.
    regards,
    Dipankar.

    You can use Ajax to call textboxes and select list based on what user enters.
    Otherwise make those items conditional and based on what user enters you can display textbox or select list.
    You can call Single Textbox and Select List using Ajax for any number of conditions.
    Regards
    Chandra

  • Set focus on item that selected in multiple-selection list box field in infopath

    Hi
    I have  multiple-selection list box field in infopath that have for example 40 items. (I customize sharepoint list with infopath),then
     publish infopath form in to sharepoint list. users want to add new item,when they selected or checked each item in multiple selection list box, after that automatically control focus on first item, but I want to focus remain on that item
    I was selected. Why this happen?! I also set postback settings to “never” in multiple-selection list box properties. But didn’t work.
    Thanks.

    Hi,
    According to your post, my understanding is that you wanted  to find several columns based on user selection of checkboxes in one of the Multiple-selection List Box.
    I recommend to customize the form to concatenate values from choice field (with multiple values) into single line text box, and then hide the fields based on the text box value.
    We can follow the steps as following:
    Add a text box control(filed 3) on the form to hold the value selection in the multiple selection list box.
    Set the default value for the text box control as
    substring-after(eval(eval(Value, 'concat(., ";")'), ".."), ";")
    (you need to change the ‘Value’ in the formula to your multiple selection list box name: filed1).
    Add the conditional formatting on the flied: flied 3 does not contain value (you need to change the ‘Value’ in the formula to your multiple selection list box value.).
    In addition, you can add Formatting action to hide the text box control.
    Here are the result screenshots for you to take a look at:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • SELECT LIST - with values after have values in other Select List

    My friends.
    I need a select list that is self - complemented, after being selected a value in another select list above.
    Can you help?
    pesquisar

    Good afternoon,
    Try this for the definition of your select list:
    select emp.emp_name as display_column,
           emp.emp_id as return_column
      from employees emp
    where emp.department = :P1_DEPT_NO
    order by emp.emp_name;This will look at the select_list called :P1_DEPT_NO, capture the value that is currently selected and then populate the EMPLOYEE select list based on the results. Just use a query like this as the one that defines your second select list.
    This seems to be a popular question. Search this forum for other information.
    Don.
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! :)

  • 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 set "Display as Text" field with AJAX select list

    thanks Denes for your posting. I'm trying to use the Denes Kubicek code to populate a "Display as Text" field. It works for Text Field (disabled), but not "Display as Text" field(saves state) . In my applciation I need to show this field only (not the disabled text box) when a select list value is changed. any ideas to modify the code below are appreciated.
    http://htmldb.oracle.com/pls/otn/f?p=31517:80:3418128396960418::NO
    here is the code from the url above
    1. Create an Application Process - getDet:
    DECLARE
    my_det VARCHAR2 (200);
    BEGIN
    SELECT ename || CHR(10) || job || CHR(10) || mgr
    INTO my_det
    FROM emp
    WHERE empno = :P80_EMPLOYEES;
    HTP.prn (my_det);
    END;
    2. Put the following in the Region Header of your page:
    <script language="JavaScript" type="text/javascript">
    function f_getDet ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
    get.add('P80_EMPLOYEES',html_GetElement('P80_EMPLOYEES').value)
    gReturn = get.get();
    if(gReturn)
    {  html_GetElement('P80_DETAILS').value = gReturn  }
    else
    {  html_GetElement('P80_DETAILS').value = 'null'  }
    get = null;
    </script>
    3. Put the following in the HTML Form Element Attributes of :P80_EMPLOYEES:
    onChange="f_getDet()";

    Arie,
    this works fine on normal page, except page zero. I have the AJAX select list and "Display as Text" field on page zero. The "Display as Text" field doesn't show the the value when AJAX select is changed. I'm using similar code as used in my other APEX page on OTN site. I tired to display the gReturn value, just before calling "setDisplayOnlyNode" function in the code below and it's showing correct value, but fails to display the value in the APEX field on page zero. Any ideas are appreciated.
    Thanks,
    Surya
    <script language="JavaScript" type="text/javascript">
    function setDisplayOnlyNode(pItem, pValue)
    { var textNode = pItem + '_DISPLAY'; $x(textNode).innerText = pValue; }
    function f_getDet ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
    get.add('P1_EMPLOYEES',html_GetElement('P1_EMPLOYEES').value)
    gReturn = get.get();
    if(gReturn)
    { setDisplayOnlyNode('P1_DETAILS',gReturn)}
    {  html_GetElement('P1_TEST').value = gReturn  }
    get = null;
    </script>

  • AJAX dependent Select lists

    Can anyone please help me figure out where am going wrong?
    I have 2 regions on page 1. Region 1 is supposed to have 2 drop down lists (cascading i.e values in second drop down Drop List HJ are dependent on value selected in first lov Ajax Select HJ). Region 2 will be a report.
    I am trying to create AJAX cascading lovs based on eg. provided on carl's application so that Region 2 is not refreshed each time I select a value from the drop down's
    [http://apex.oracle.com/pls/apex/f?p=36391:37:1510004986327720::NO:RP::]
    I have downloaded the application and tried to do the exact same steps, but my child lov is not updating its values after I select a value from in Ajax Select HJ.
    My application is available at http://apex.oracle.com/pls/apex/f?p=33829:1:2010637670427735:::::
    Appreciate any help on this
    Thank you
    Deepu

    Thank you Denes !! The example really helped me. Now I am stuck at the next level. I am new to apex and learning and building dashboard for my organization. So, please bear with me.
    I have a page that is divided into 4 regions. Each region displays a chart that is generated dynamically. When I say dynamic, each region has 2 drop down lists.
    First pull down has Org and Year as values, if they wish to view chart by Org or Year. If they choose Org, second drop down defaults to Org. If they choose Year, second drop down displays Year's as 2010, 2009,2008 so on. Depending on which year they choose they should be able to view that Year's chart by month in that region.
    Initially I had used select lists with submit for drop down's but that was refreshing the whole page. But now after using your example with AJAX I was able to accomplish the cascading Lov's stuff. Now, after user selects a value in second drop down, is there a way that I can display the chart and refresh only that region each time user selects a value from the drop down.
    I want to avoid refreshing the page each time, I need each region to refresh based on user selection in drop down's. Is this possible in apex? Is there any example that you could direct me to.
    Thank you so much for all your inputs. Appreciate it very much
    Deepu

  • AJAX Dynamic Select List

    Hello Ladies and Gentlemen,
    I have a Select List, :P9_ELEMSTRUCTSAISIEPARCBO, based on a hidden item, :P9_NOSAISIEPAR, and this is the query it's based upon:
    select Description, ElemStructID
    from V_ElemStruct, V_Dispensateur
    where DispensateurID = DispensateurIDResponsable
    and NumeroDispensateur = :P9_NOSAISIEPAR
    order by DescriptionI also have a popup page that shows a report with a column link that passes back values to the original page, and one of those values replace :P9_NOSAISIEPAR's current value. I want to reload the Select List via AJAX, so that the changes can be in real-time. I found Carl Backstrom's (He was a wonderful man) tutorial on his application (http://apex.oracle.com/pls/otn/f?p=11933:37) and decided to try it. But it just won't work, and I have no idea why.
    I know the popup works just fine, and I tested the On Demand Application Process in the SQL Commands of the SQL Workshop and it seems to be working just as fine. Thus, I've narrowed it down to the thought that the JavaScript must be the problem, logically.
    Here is the code for the "HTML Form Element Attributes" of the :P9_NOSAISIEPAR hidden item:
    onChange="f_PopulateField(this,'P9_ELEMSTRUCTSAISIEPARCBO')"Here's my on Demand Application Process:
    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
         Description as Description,
         ElemStructID as ElemStructID
       from
         V_ElemStruct,
         V_Dispensateur
       where
         DispensateurID = DispensateurIDResponsable
         and NumeroDispensateur = :F102_TEMP_APP_ITEM
       order by
         Description
      ) loop
      htp.prn('<option value="' || rec.ElemStructID || '">' || rec.Description || '</option>');
      end loop;
      htp.prn('</select>');
    end;and here's my JavaScript:
    function f_PopulateField(pThis,pSelect)
      var l_Select = $x(pSelect);
      var l_Return = null;
      var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=PopulateField',0);
      get.add('F102_TEMP_APP_ITEM',pThis.value)
      gReturn = get.get('XML');
      if(gReturn && l_Select)
        var l_Count = gReturn.getElementsByTagName("option").length;
        l_Select.length = 0;
        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)
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    else
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    I have installed FireFox and FireBug, and I tried to debug my JavaScript, and that made me realize something. In the FireBug's HTML tab, :P9_NOSAISIEPAR doesn't have any onChange events mapped to it (and all my other items which should have an event mapped to them do have one).
    <input type="hidden" id="P9_NOSAISIEPAR" value="2222" name="p_t63">compared to:
    <select onchange="$f_Show_On_Value_Item('P9_SECURITAIRE','P9_NOTEACCOMPAGNATEUR',1)" id="P9_SECURITAIRE" size="1" name="p_t23">So, my best bet is that the JavaScript doesn't even get executed by the page at all (it's not appearing in FireBug's JavaScript tab at all either). Any idea why?
    Best regards,
    Mathieu

    I finally found a way to do it. When selecting my value in my popup page, I show my hidden field, change the value, manually call the onChange event, hide back my hidden field, and then close the popup. That way the onChange event fires in IE. Afterwards, as a workaround to the XML not being recognized by IE, I changed
    get.get('XML')for
    get.get()to get a string instead of some XML, and I parsed it to XML DOM using a manual parser (because IE is too weak to have its own). Here is the code for the DOMParser.
    if (typeof DOMParser == "undefined")
        DOMParser = function () {}
        DOMParser.prototype.parseFromString = function (str, contentType)
          if (typeof ActiveXObject != "undefined")
            var d = new ActiveXObject("MSXML.DomDocument");
            d.loadXML(str);
            return d;
          else if (typeof XMLHttpRequest != "undefined")
            var req = new XMLHttpRequest;
            req.open("GET", "data:" + (contentType || "application/xml") +
                             ";charset=utf-8," + encodeURIComponent(str), false);
            if (req.overrideMimeType)
              req.overrideMimeType(contentType);
            req.send(null);
            return req.responseXML;
      }It wasn't written by me, I found it on Erik's Weblog (http://erik.eae.net/archives/2005/07/03/20.19.18/), so all credit goes to him.
    Best regards,
    Mathieu

Maybe you are looking for

  • MINI DVI to HDMI Connection Issue

    I have a July 2009 white macbook 2.13 GHz Intel Core 2 Duo Mac OSX 10.5.8. I have been trying to connect my laptop to a Sanyo 42in HDTV and a VIZIO 47in with no success. I purchased two different mini-DVI to HDMI cables(both with great reviews) and n

  • Jframe is flickering -- Urgent help please!

    Basically i want to resize the window when i click some button say, NEW or EDIT and making some components visible. I am using setSize() method to resize the Jframe/window and setVisible() method. Do i need to use other methods. If you need some othe

  • How can i see page in application

    i have developed a page use OA framework, how can i apply the page into application, how to setup, which folder should i upload the file?

  • Virus pop up window

    I was searching for hotels on my mac book and I got a pop up window that looked like a message from Safari saying that I should download this file as it would clean up viruses that had come onto my system. I accidently clicked on it but then cancelle

  • Itnues : clé non valide pour l'utilisation dans l'état spécifique

    Bonjour, Actuellement je rencontre un problème pour réinstaller iTunes, l'erreur a l'installation est : clé non valide pour l'utilisation dans l'état spécifique. j'ai désinstaller la vers 11.3 et souhaite réinstaller la dernière version. Avez vous un