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

Similar Messages

  • 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>

  • 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

  • AJAX Select list implementation

    Hi,
    I'm trying to implement the AJAX Code Generator from Scott ( http://htmldb.oracle.com/pls/otn/f?p=33867:2 ) using dept no select list and dept name text field. When I change the Dept# selection from the options, all I get is a huge chunk of html code in my dept name text field and it doesn't contain the result.
    Can any one help me out with what i'm doing wrong?
    Thanks.
    - Richard

    Carl,
    Thanks for helping me out.
    Important thing I missed to mention in my original post.... I'm using HTMLDB ver 1.6 copied the js files needed, from htmldb.oracle.com
    Here is the url for the page I created in htmldb.oracle.com. But, when I recreated it, the onchange gets me "null" in department name field instead of huge chunk of HTML code.
    http://htmldb.oracle.com/pls/otn/f?p=19793:24:

  • AJAX Select Lists on Updateable Reports

    All,
    I have followed the examples from Karl and Sergio's blog on how to use AJAX to contol dependent LOV lists in a form. My question is, can this be done in an updateable report? I'm having difficulty in determining how to reference the column names of the dependant lists.
    What I basically have is a time app. User selects his project from a picklist and then his associated tasks for that project will appear in the task list. I have used the updatable report option to build this rather then a form, because I liked the prebuilt add row and processing functionality.
    Anyway if anyone knows how to use AJAX dependant select lists in an updateable report it would be greatly appreciated.
    Thanks
    Rob

    See http://forums.oracle.com/forums/thread.jspa?messageID=1222153&#1222153

  • Ajax select list with an updateable report

    Hi,
    I have an updateable report where the first 3 columns are all select lists and where the values in each of the select lists are dependent on the value selected in the previous select list.
    I've been able to implement this for the first 2 columns using ajax ie. the values in the select list for the second column are based on what value has been selected in the first column, but I have not been able to apply the same logic to the list of values for the 3rd column, which should be based on what has been selected in the second column.
    Also, when the value of the first column is changed, it should be blanking out the values of the 3rd column, until the new second column value has been selected, based on the change to the value of the first column.
    Any assistance/advice would be much appreciated.
    Many Thanks,
    Marquita

    How did you do that for the fisrt 2 columns, I could only do it in a form not in a report, appreciate your help

  • Variable not in select list issue

    Hi friends,
    To the existing OBIA mapping, that is for one of the SDE mapping i dragged a single column from source to source qualifier and also updated that column in the sql query of the source qualifier and finally dragged it to my target staging table.
    After that if i tried to run that SDE task in my DAC means, it is failing and returning the below error in log
    ora-01007 variable not in select list in informatica
    since i have checked and verified the order of the column in the source qualifier port and the query. It is same, but then too returning the above error.
    What is the fix for it.
    Thanks in advance.
    Regards,
    Saro

    Hi Svee,
    Thanks for the reply.
    I followed the below link for adding the extra column to the per-built mapping
    http://www.rittmanmead.com/2008/07/amending-existing-category-1-sde-and-sil-mappings-in-oracle-bi-apps-795/+_
    Hence for example, i copied the workflow of SDE_ORA_AbsenceEvent to my new custom folder. In that i just tried only with SDE mapping(from source to staging)
    i had three source tables for it
    per_absence_attendances
    per_absence_attendance_types
    per_abs_attendance_reasons
    Target(staging table)
    W_absence_event_ds
    i tried of adding a date column "last_updated_by" from the table "per_absence_attendances" to the staging table "W_absence_event_ds"
    Before adding the date column, i just tried by copying the SDE_ORA_AbsenceEvent to my custom folder and tried to execute that in DAC as it is loading successfully in my target(staging table) "W_absence_event_ds".
    After that i added the date column to the target(staging table) "W_absence_event_ds" and tried to execute the same in DAC, but @ that time only im receiving the variable error.
    Like you said
    since its OOB mapping you should have 2 workflows(full and incr) for the same mapping, make sure your changes are affected to workflow ending with _Full.I dint copied the workflow SDE_ORA_AbsenceEvent_full to my custom folder. Whether is this the problem for this variable error whether can i copy the full(workflow) and can i try.
    And also a good news that OBIA 7.9.6.4 and DAC 11g released.
    http://www.oracle.com/technetwork/middleware/bi-enterprise-edition/downloads/bi-downloads-1525270.html_+
    Regards,
    Saro

  • Cascading select list issue in a tabular form

    hello,
    how can i implement cascading select list for filtering my tabular form report results.
    Like i want to have the cascading select list above the tabualr form report such that when i select the value and try to click a button, my tabular form report should filter the report based on the select list value.
    i want to have three select list items above my report - and these select list are dependent on one other - tats why i want to make them cascading select list.
    can anyone help me out with cascading select list.
    thanks.

    Thank you so much for the quick response saved my life!.
    For future reference let examples of the use of APEX_UTIL.SAVEKEY_VC2 and APEX_UTIL.KEYVAL_VC2
    This is the query of the Tabular Form
    SELECT   den.cod_encuesta,
             den.cod_det_encuesta,
             den.cod_pregunta,
             pre.nombre_pregunta,
             den.respuesta,
             den.observaciones,
             APEX_UTIL.SAVEKEY_VC2(den.cod_pregunta) codpreg
      FROM   enc_det_encuesta den, enc_pregunta pre
    WHERE   den.cod_pregunta = pre.cod_pregunta  
       AND   den.cod_encuesta = :P6_COD_ENCUESTAThis is the query "Select list"
    SELECT   nombre_respuesta, cod_respuesta
      FROM   enc_respuesta
    WHERE   cod_pregunta =  APEX_UTIL.KEYVAL_VC2regards
    Gerard

  • SELECT LIST about...

    Hello.
    Is there any way to create multiple 'select list's. That each one depending on each other? There are three 'select list' in my case.
    First - city
    Second - department
    Third - Person
    Of course, if I change 'city' one I want other two to change automatically BUT - without reloading page! Is it possible? There are department with very low connection rate - often reloading page - is very expensive for them..

    Why there is no answer? Are my question silly?Well...there are a few reasons for that -
    1) It's the weekend
    2) You have waited less than an hour for a reply.
    3) Nobody is 'paid' to provide support on these forums, we all do it for free in our (limited) spare time (see point 1)
    Yes what you have asked is achievable, take a look at the following blog posting by Scott Spendolini which you should be able to use and adapt
    http://spendolini.blogspot.com/2005/10/ajax-select-list-code-generator.html

  • Apex 4.0 Cascading Select List: ajax problem with german umlaute

    Hi everybody,
    Apex 4.0
    Dad PlsqlNLSLanguage: GERMAN_GERMANY.WE8MSWIN1252
    I have problems with german umlaute and ajax cascading select lists (Cascading LOV Parent Item).
    The data is populated without a page refresh in the select list when the parent select list changes but special signs like german umlaute are shown as weird characters.
    Seems like there is some charset problem with ajax.
    This is the only part of the application where special signs like umlaute are messed up. Everything else is fine.
    I allready tried to figure out if I can escape the umlaute in the javascript (file apex_widget_4_0.js) but no success here.
    Can anybody help me with this issue?
    Thanks in advance,
    Markus

    Hi Markus,
    your specified character set in your DAD is wrong. As mentioned in the installation instructions at http://download.oracle.com/docs/cd/E17556_01/doc/install.40/e15513/otn_install.htm#CHDHCBGI , Oracle APEX always requires AL32UTF8.
    >
    3. Locate the line containing PlsqlNLSLanguage.
    The PlsqlNLSLanguage setting determines the language setting of the DAD. The character set portion of the PlsqlNLSLanguage value must be set to AL32UTF8,
    regardless of whether or not the database character set is AL32UTF8. For example:Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Select List Performance Issue in Apex 3.1.2

    Hi
    It would of great help if you could suggest us for the following
    We are facing some issues in Select List performance in Apex 3.1.2 version.
    We have 6 select list and all have been cascaded i.e., values of each select list based on pervious list value.
    Values in each select list are huge. Because of this, the performance is very slow.
    It takes huge time to fetch the data based on other list values.
    We cross verified in backend, the same query takes less time compared to the Application.
    Any recommedation to fine tune this?
    Thanks in advance
    Vijay

    if your select lists are very huge then it could be the browser that is causing the slow down.
    try and create an example using a static HTML file containing a select list of the same size and you may find the same performance issue.
    a quick way to create the test would be to save the source of your APEX page as a html file
    Craig
    [http://www.oracleapplicationexpress.com]

  • Select list with submit issue when they are referred in report region query

    I have a page with a reporting region. Same region also has 3 different list items and depending on the value selected in each item, the report is refreshed. All the 3 list items are "Select list submit with submit"
    Out of 3 items, 2 (say item2 and item3) are populated through dynamic LOV using the value in item1.
    Additionally, when I select a default "ALL" value in in item1, I ignore values in item2 and item3.
    With this background, I am a following issue:
    1. I select a value other than Default value in item1 which filters the report.
    2. Then I select some value in item2 which further shrinks the reports.
    3. Now if I go back to item1 and select the default "All" value, the report is not refreshed with the new values of item1, item2 and item3. But it still shows the report based on value of item2 that I selected in step2.
    How do I set the value of item2/item3 to null if value of item1 is default which is "All"
    Any word of advise will be a great help!
    Thanks,
    Girish

    Hi,
    Make two computations each with the computation text NULL; or
    Make one process with code like:
    BEGIN
    :P1_ITEM2 := NULL;
    :P1_ITEM3 := NULL;
    END;With the condition "Value of Item in Expression 1 = Expression 2"
    Expression 1: P1_ITEM1
    Expression 2: ALL
    (or whatever the return value of ALL is...remember that this is case sensitive)
    Mike

  • 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

  • Select list and hidden display issue

    Hi all,
    I am using a dynamic value select list, which when a button is pressed sets the value of a hidden display item. The next page then uses the hidden display item as part of an SQL query.
    It strangely sometimes works and sometimes doesn't - it often struggles with the values in the select list which are over 30 characters.
    Does anybody have any idea what's going on?
    Many thanks,
    Tom

    Hi
    I just re-ran the debug feature and have found an issue which could be the cause of the problem:
    Som of the data items in the dynamic select list have and ampersand (&) symbol. If I run the page once the hidden item displays the value properly:
    0.22: binding: ":HIDDENREGION"="HIDDENREGION" value="Tech Comms Media Utilities & Hi-tech" if I re-run the page after navigating around the application for a bit is displays this value:
    0.22: binding: ":HIDDENREGION"="HIDDENREGION" value="Tech Comms Media Utilities &amp; Hi-tech"Please notice the "& amp;" bit which has been added... Is there any way of getting rid of this? as it is interfering with the query on the next page.
    Many thanks,
    Tom
    Edited by: new_to_apex on Mar 2, 2009 3:13 AM
    Edited by: new_to_apex on Mar 2, 2009 3:14 AM

  • 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.

Maybe you are looking for

  • Error when saving Crystal Report into BOE

    Hi there, I'm having problem on saving rpt (with parameter) into BOE. My rpt is working fine in Crystal Report 2008. I've tried to Add Crystal Report using Save As, and returned error: Error Message: Failed to read data from report file: abc.rpt. Rea

  • EHP4: Education & Previous employment in ESS

    Hi, We have implemented EHP4, according to SAP their should be new iviews for Education & Previous employment in ESS. Anyone could share his/her experience implementing this new iviews? Looking forward to your reply. Regards, Onno

  • Is chroma bug solved in new version of AME5.5 when transcoding to ProRes?

    About a year ago I had posted to the forums about a "chroma bug" observed by me and others when using Adobe Media Encoder v.5.0.1  to transcode AVCHD to Pros Res 422.   It would result in chroma bleed and a softer image versus a sharper transcode usi

  • HT1212 i want to register my new iphone on my computer

    i want to register my new 5s iphone on my computer

  • Migrate bookmarks from old hard drive

    My old iMac died. The OS was 10.5.8. I removed the internal HD and it needs to transfer to the new system under 10.8.4. I have been trying to locate my old bookmarks from the HD that was taken out from the old iMac but not successful. Please show me