Slight problem of AJAX selection list, I hope...

I probably looked at all the examples that uses AJAX to fill selection lists that are out there and eventually got a job almost completely.

In my application, I use a form on page 23 to create a folder and then also use a form on page 22 to update a record. Two of these pages, I have 2 selection lists that use AJAX to complete each other. On my page of form creation, these two select lists display properly and correctly submit a report page.

Now, when I click on the document I just create the homepage, I get redirected to the update (page 22) page where I just submit all items are displayed correctly except the second selection list. The second selection list displays the correct list of the elements in the selection list, not the one I had just chosen. What is shown is the first option in the selection list, no matter what I had selected when I created the folder. Always the first option display anything in my code?

Thank you
Deanna

For example:

My current output:

P.23 (creation of registration)
Parameters:
: P23_CASE_NUMBER - 9999999999
: P23_CONT_FACTOR_CATEG - driver distracted by
: P23_CAUSES - other electronic devices

PG.22 (update record)
Parameters:
: P22_CASE_NUMBER - 9999999999
: P22_CONT_FACTOR_CATEG - driver distracted by
: P22_CAUSES-Mobile (cell) phone (WRONG)(first option in the list)
--------------------------------------------------------------------------------------------------------------------------------------------------

The output that I would see:

P.23 (creation of registration)
Parameters:
: P23_CASE_NUMBER - 9999999999
: P23_CONT_FACTOR_CATEG - driver distracted by
: P23_CAUSES - other electronic devices

PG.22 (update record)
Parameters:
: P22_CASE_NUMBER - 9999999999
: P22_CONT_FACTOR_CATEG - driver distracted by
: P22_CAUSES-other (CORRECT) Electronic Devices


Current code 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

There are a number of issues here:

1. remember that creation and editing features are on TWO different pages - when you refer to "the page is not save...". ' is in fact another page
2. in the CHART table, you have an ID column AND a column RECNUM. You use the RECNUM column in the report link. In the CHART table, there are plenty of duplicates in the column RECNUM, which made it impossible for me to test - whenever I've created a new record that he got the same RECNUM value as an existing record, and I couldn't change then my new record as the process of "search...". ' incorrect 'more than one folder. You must use the ID column in the link, because it is unique
3. on the selection of CAUSE list, you had a few items in quotes - I have no idea why. It was actually a good deal to do for your original problem. During the construction of the selection list, the value of the CASE is used as the VALUE attribute on the OPTION tag by enclosing it in quotes. What were you end up with is: < OPTION VALUE = '"sometext" ' > 'etc' < / OPTION >. The VALUE is, therefore, ""-an empty string. I removed the quotes from the data
4. more importantly, as the CAUSE table made a unique ID column, this should be used as a return value for the list and therefore, the value stored on the CARD table. If you do this, you use the quotation marks if they are in some cases

Andy

Tags: Database

Similar Questions

  • AJAX select list with checkbox cascading

    Hello

    I point the selection and dependent check list item on a form. When a user selects a selection list value, this value must be used in the query for the checkboxes to filter this value while displaying the boxes with the AJAX implementation. any ideas are appreciated.

    Kind regards
    Surya

    Or a slightly different version:

    http://Apex.Oracle.com/pls/OTN/f?p=31517:236

    Denes Kubicek
    ------------------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    ------------------------------------------------------------------------------

  • problems with customization select lists and popup LOVs

    Hello


    I have 2 problems on selection lists and popup LOVs.

    The first is on a list in tabular form.
    It must be created with APEX_ITEM. SELECT_LIST_FROM_LOV or similar and take its values of a named LOV.
    This worked fine, but now it should also have the possibility to enter a free value.
    I tried to accomplish this by creating an APEX_ITEM. POPUP_FROM_LOV, but there is a problem with the function which is called the icon of the right arrow to the input field (for eg. genList_f11_5()).
    If the line is added by addRow, then it works fine, but if the line is not empty
    Then the function call is as genList_f11_$ _row () and the input field becomes worthless, when an LOV is selected.


    The other problem is on a list of selection that should have the opportunity to enter a custom value and
    It should also be able to select multiple values. I tried to implement this in a text box that contains the selected values, and a multiple select list, with an event handler in each option. The user can click on options and they would be copied into the text box. The problem is that I couldn't make the event handler works in Internet Explorer.

    I would like ideas on one of these problems.



    Tiina

    Hello

    It can be created at APEX_ITEM. TEXT.
    APEX_ITEM also generates the name attribute that I use the jQuery selector in the sample.
    Use jQuery UI autocomplete just similarly as in my example with APEX_ITEM

    Kind regards
    Jari

  • The hide/show button with the AJAX selection list

    I have the button named "QUERY" and AJAX list selection page #2 'ID'. When my selection list value is 100, I would like to display the button, otherwise hide the button. I checked the session values are defined correctly for the selection list when I change the value, but the following code in one of the messages in the forum does not work. is it different for elements of AJAX?

    Added the following code to select the list - onchange = "disble_enable_button (); »

    function disble_enable_button() {}
    If x$ ('P2_ID') .value = '100'
    x True $('P2_QUERY') = true;
    for other x $('P2_QUERY') true = false;
    }

    Hello

    function disble_enable_button() {
    if ($v('P2_ID') == '100')
    $x_Show('P2_QUERY');
    else $x_Hide('P2_QUERY');
    }
    

    Mike

  • Problem with the selection list dynamic LOV using bind variables

    I have the following SQL to fill a selection list:

    Select d, ch from
    (
    Select ft. FAMT_NAME d, pi. R FAM_ID_T of FAMILY_TRA ft
    Join the ck list
    on ck.family = ft.famt_name and ck.newseq in (: NEWSEQ_QUERY_SQL)
    )

    Where NEWSEQ_QUERY_SQL is a part of the application that is defined by a calculation of page and essentially returns a list of values NEWSEQ based on some parameters of the user query. For example:

    Select distinct (ck.newseq) in the ck list where rownum < 20

    The query above works fine with SQL Developer and returns two columns needed (display_value, return_value)

    However, it returns no line, when it is used to fill the LOV to a selection list.

    If I replace the: NEWSEQ_QUERY_SQL with a list of NEWSEQ hard-coded, it works:

    Select d, ch from to)
    Select ft. FAMT_NAME d, pi. FAM_ID_T r
    of FAMILY_TRA ft join checklist ck on (ck.family = ft.famt_name and ck.newseq in ('K0242900', 'K0217200'))
    ) ;

    I can even replace: NEWSEQ_QUERY_SQL with hard-coded SQL and it works:

    Select d, ch from
    (
    Select ft. FAMT_NAME d, pi. R FAM_ID_T of FAMILY_TRA ft
    Join the ck list
    on (ck.family = ft.famt_name and ck.newseq in (select ck.newseq from the list ck where rownum < 20))
    )

    But if there is a connection variable (: NEWSEQ_QUERY_SQL), it doesn't.

    Selection lists are driving me crazy! They seem incredibly capricious.

    Hello:

    You cannot link a "sql statement" that bind the value you're trying to do.
    P2_FAMILY_LIST must be the SQL statement you executed for the LOV. Something like

    select d, r from
    (
    select ft.FAMT_NAME d, ft.FAM_ID_T r from FAMILY_TRA ft
    join checklist ck
    on (ck.family = ft.famt_name and ck.newseq in (select ck.newseq from checklist ck where rownum < 20))
    )
    

    CITY

  • Problems with dynamic selection lists in IE7

    I have another problem related to the last one I posted here: http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=217 & threadid = 1385428

    I have a list of dynamic selection populated by a SQL Server database.

    I want to select all the items in the list if you have selected a particular item. The code I wrote works fine in Firefox, and I'm assuming that other browsers as well. It does everything not in IE and the specific test does not not in IE7.

    I can't use the fix suggested for my last question, because this time I want all of the selected options and selectedIndex applies only to a single option.

    Any ideas on what I can do to make it work in IE7?

    Here is the code I use:

    I have provided a solution to this question in another forum:

    http://www.Tek-Tips.com/viewthread.cfm?QID=1495671&page=1

    Thank you
    Jesse

  • NVL selection list does not not on the place where clause in query

    Ok. APEX 4.2...

    Im having problems with my selection lists and NULL values... I see that it has come time and time again...

    I have a tabular presentation, with a query based on a selection list.  The selection list has the ability to '- Show All -'... The value of the selection list is a number, and the display is words...  (for reference the LOV query is: select status, batch from pmt_stat_lookup by 1)

    Initially I had problems with null and invalid numbers like ' display Null = 'Yes' and the problem of null % ', so have used the code in this blog to remove the NULL values... Display Null = & amp; #34; Yes & amp; #34; and the problem of null % | Inside Oracle APEX by Patrick Wolf

    Then in the application of my report, I have a where clause clause that checks the value of the selection list... WHERE batch = nvl(:P11_STATUS_SELECT,STATUS_ID)

    everything works almost fine, and I can choose a status, or I choose - see the All-, but the query will not include the lines where the State is null.

    (I also see that maybe I should be, use the case statement instead of the NVL on where clause, but not sure of the syntax. In addition, NVL was used somewhat in the different reports in the application...)

    For reference, the code of the old blog that I as a process page is:

    BEGIN

    FOR rItem IN

    (SELECT NOM_ELEMENT

    OF APEX_APPLICATION_PAGE_ITEMS

    WHERE APPLICATION_ID = TO_NUMBER(:APP_ID)

    AND PAGE_ID IN (TO_NUMBER(:APP_PAGE_ID), 0)

    AND LOV_DISPLAY_NULL = 'Yes'

    AND LOV_DEFINITION IS NOT NULL

    -change here

    AND LOV_NULL_VALUE = '% null | '%'

    )

    LOOP

    IF V (rItem.ITEM_NAME) = "% null | '%'

    THEN

    Apex_Util.set_session_state (rItem.ITEM_NAME, NULL);

    END IF;

    END LOOP;

    END;

    Thank you very much

    Richard

    Richard,

    Perhaps this example can help you solve your problem.

    https://Apex.Oracle.com/pls/Apex/f?p=63838:2

    Jeff

  • Change a selection list using javascript

    Hi all

    yesterday, I had a doubt using apex_item.checkbox and how to modify them using javascript:
    Re: Passing a checkbox as a parameter to a javascript function

    Today, I am facing a similar problem, but with select lists. Here it goes. I have a report with apex_items, like this:
    select 
    apex_item.checkbox(1,"ID",NULL,NULL,NULL,'f01_#ROWNUM#') " ",
    apex_item.select_list_from_lov(2,"SW_STATUS",'F2010051_SET_STATUS','onChange="setItems(''f01_#ROWNUM#'',''f03_#ROWNUM@'')"','NO') sTATUS,
    apex_item.select_list_from_lov(3,"REVISIO",'F2010051_SET_REVISIO',NULL,'NO','f04_#ROWNUM#') "REVISIO"
    from Fx1_v
    The javascript code is as follows:
    <script type="text/javascript">
    function setItems(cb,estat){
      elem = $x(cb);
      alert(elem.value);
      $x(cb).checked = true;
    
      elem2 = $x(estat);
      alert(elem2.value);  
    }
    </script>
    The idea is that whenever the g_f02 (a selection list) element changes, call the JS function with two parameters: a checkbox (g_f01) and another select list (g_f03). The function should change the items in a defined values. The box changes ok thanks for the help I had yesterday, but I can't work with the third element (list g_f03). When I try to show the value, it says no "defined."

    How can I see the real value of the LOV selection list and change to 1, for example?
    Thank you very much, any help will be appreciated!

    Published by: Elena.mtc on 19-May-2011 08:11

    Hello

    Do you have the typo in the query?
    Should it be

    select
    apex_item.checkbox(1,"ID",NULL,NULL,NULL,'f01_#ROWNUM#') " ",
    apex_item.select_list_from_lov(2,"SW_STATUS",'F2010051_SET_STATUS','onChange="setItems(''f01_#ROWNUM#'',''f03_#ROWNUM#'')"','NO') sTATUS,
    apex_item.select_list_from_lov(3,"REVISIO",'F2010051_SET_REVISIO',NULL,'NO','f04_#ROWNUM#') "REVISIO"
    from Fx1_v
    

    And JavaScript

    
    

    Kind regards
    Jari

  • Select list first value problem using AJAX

    Hello

    I've implemented the list of selection in AJAX by allusion to Denes Kubicek - http://apex.oracle.com/pls/otn/f?p=31517:119:3737449055187298:NO. I have only 2 selection lists. The AJAX functionality doesn't quite work for the first selected value in the list select a first. I get not all values in second SelectList when the first value is selected in the first SelectList. It works very well for the rest of the values in the first selection list. I kept a few warning messages to debug JavaScript. I think the problem is with the function below,

    get var = new htmldb_Get (null, html_GetElement('pFlowId').value,
    = States_In_County', 0);
    Get.Add ('F109_AJAX_COUNTY', html_GetElement (pThis) .value);
    gReturn = get.get ('XML');

    For the first value in the first list of Select, gReturn.getElementsByTagName("option").length; Returns 0.

    Hello:

    What is the value of the 'back' of the article 1st of the 1st list select? The value is compatible with the data type of the column of wl.location_id?

    CITY

  • Newb AJAX - construction hyperlink from two selection lists

    Hi people,

    Would anyone familiar with care of AJAX to help out me? I am very new to AJAX, and I'm trying to set up a page that generates a URL hyperlink based on two input chooses. By example, if the first select statement was 'IT' and the second 'APPL' the URL to be returned would be


    http://Apex.Oracle.com/pls/OTN/f?p=28213:2:803955090371716:no:2:P2_SUPPORT_DEPT, P2_SUPPORT_TYPE:IT, APPL

    The reason for this is because I want an easy way for employees to create links in their email signatures that correspond to their assistance and group service. In this way, when a customer clicks the link in the signature of the employee these two selection lists is already selected for customer when they submit comments on this employee.

    We invite you to check what I have up here on apex.oracle.com:

    WORKSPACE: ARES_APEX
    USERNAME: ACE
    PASSWORD: h3lpf4l

    (MBDR - 28213)

    My error console JavaScript told me that two of my functions are not defined, but I know that 'change_support_type()' works is a "show_url()" I think that I probably need a lot of help.

    Thank you all for all the wonderful help that you have provided and will provide this forum. :)

    -Anton

    Published by: sleeper on August 28, 2008 12:07

    Published by: sleeper on August 28, 2008 12:29

    Hello

    You had a few problems with your javascript code.
    The one that you just had a plain error (wrong number of media which has been lifted) and the error.

    You select AJAX were working properly, but then to get the other content, you tried pulling XML reuse and analysis and the other which is excessive. He needed just to get the snippet of text and push it into the page.

    Here is your http://apex.oracle.com/pls/otn/f?p=28213:4 working page

    and here is your new code

     function change_support_type(pThis,pSelect){
        var l_Return = null;
        var l_Select = $x(pSelect);
        var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=change_support_type_page_4',4);
        get.add('P4_SUPPORT_DEPT',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;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);}
    
    }
    
    function show_url(pThis, pThat){ var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=show_url',4);get.add('P4_SUPPORT_DEPT',$v('P4_SUPPORT_DEPT')); get.add('P4_SUPPORT_TYPE',$v('P4_SUPPORT_TYPE')); gReturn = get.get();     $x('drop_content').innerHTML = gReturn;get = null;}
    
    You can read more about our Ajax framework here [http://apex.oracle.com/pls/otn/f?p=11933:63]
    
    Also when developing AJAX you should use Firefox with the Firebug addon , even if your building for an IE only environment, it makes debugging AJAX and javascript issues much easier.
    
    Edited by: Carl Backstrom on Aug 28, 2008 12:56 PM 
    
  • selection list loading using the ondemand/ajax process data

    Guys,

    Ive has a selection list that has a query default LOV (select jobname d, jobid r of the work) but now iam trying to create application processes to pass new values LOV (like select ename d, empno from emp by 1 r) replacing the previous lov when a button is clicked

    any idea please?

    Apex 4.2.x

    Kind regards

    Gor_Mahia wrote:

    fac586

    good idea to use the function in the pipeline, but I really want to use ondemand/ajax call here I don't mind spending extra energy so long as its feasible

    I never mentioned in pipeline functions.

    A dynamic LOV can be created as either a static SQL query:

    select ename l, empno v from emp order by 1
    

    or in the body of a function that returns a SQL query:

    declare
    
      lov_sql varchar2(4000);
    
    begin
    
      if :foo > :bar
      then
        lov_sql := 'select dname l, deptno v from dept order by 1'
      else
        lov_sql := 'select ename l, empno v from emp order by 1'
      end if;
    
      return lov_sql;
    
    end;
    

    This will allow you to create a dynamic data source for the LOV using some logic is required. LOV options can be modified using standard dynamic action of refreshment. There is no need to create an additional On demand process or write complex AJAX code. Use declarative when possible.

    "Less code is less than bugs. Seek ways to write less code. "- Tom Kyte

  • Weird problem with the width of the selection list

    4.1.1

    Hello

    I got a selection list filter that has three values null, Y and n. based on what the user selects a tabular presentation is filled with data that also has a list of selection.

    Now, earlier, I had only two values Y and N in the selection filter, and according to the selected option list, select tabular list would be filled as well as other areas. Select the 'tabular forms' list for all lines are the same width. When I added the Null value option in, select the filter, now the tabular form displays all of the values, however, the selection list is of different sizes according to the length of the text.

    I put in the CSS Style of the selection list - width: 20px

    I also tried the option element width, but still no luck, when I select Y or N to the upper filter select, selection lists appear correctly with the same width.

    No idea what could happen?

    Just to confirm, the problem is with the width of selection tabular list.

    Thank you
    Ryan

    ryansun wrote:
    4.1.1

    Hello

    I got a selection list filter that has three values null, Y and n. based on what the user selects a tabular presentation is filled with data that also has a list of selection.

    Now, earlier, I had only two values Y and N in the selection filter, and according to the selected option list, select tabular list would be filled as well as other areas. Select the 'tabular forms' list for all lines are the same width. When I added the Null value option in, select the filter, now the tabular form displays all of the values, however, the selection list is of different sizes according to the length of the text.

    This seems odd. Can you reproduce this on apex.oracle.com? What browser do you use?

    I put in the CSS Style of the selection list - width: 20px

    I also tried the option element width, but still no luck, when I select Y or N to the upper filter select, selection lists appear correctly with the same width.

    No idea what could happen?

    All functionality of another column using the column Standard report basically, means the "CSS" Style property is not applied (see, for example: {: identifier of the thread = 1001577}), then the attributes of the element, link attributes etc. should be used.

    Tabular controls, to use the standard approach of HTML attributes. Come in

    style="display: block; width: 200px;"
    

    in the property of the attributes of the element.

  • Select list type delay problem

    I have a Select list with a couple of hundred values produced, in alphabetical order. The first characters of each value in the list is an identification code. In our society, that we know and make reference to our products by their identification codes, and we know them quite intimately. So instead of scrolling to find the ID that we want, we will often simply press the drop down arrow and start typing the identification of interest code, and the advance list automatically to the appropriate location.

    So let's say our identification code is CBX197. I hit the drop-down arrow for the field and start typing: C B X 1 and then I pause briefly after typing these four characters (somewhere between 1/2 and 1 second). At this time, these previous characters I typed are "forgotten", so that when I hit '9', hoping to jump down in the section CBX19 of the values, instead it jumps to the first code ID that begins with "9", as if I had never typed the first four characters at all.

    So the question is: that that the amount of time that typed characters are held in the drop-down list of controls buffering before being thrown out and is this amount of time something that we can control in Apex? I would like to be able to specify that the buffer is valid for x number of seconds.

    Maybe it's just a built-in feature of drop-down lists in general, and there is nothing that can be done about it. But I thought I'd ask anyway.

    In my view, it is HTML implementation, could not see a way to change behavior at the Apex.

    My suggestion to approach, especially due to the high number of options in the list, would be to set up a "list of AutoComplete" (Ajax based), as this demo:
    http://Apex.Oracle.com/pls/OTN/f?p=31517:53

  • AJAX Select function lists

    Is someone can you please help me understand where mistaken?

    I have 2 regions on page 1. Region 1 is supposed to have 2 drop-down list lists (values IE cascading in the second menu dropdown Drop list HJ are dependent on the value selected in the first lov Ajax select HJ). Region 2 will be a report.

    I have tried to create lovs in cascade AJAX based on for example. condition at the request of CARL so that region 2 is not refreshed whenever I select a value in the drop-down list below
    [http://apex.oracle.com/pls/apex/f?p=36391:37:1510004986327720:NO:RP:]

    I downloaded the app and tried to do the same exact steps, but my lov child is not updating its values once I've selected a value of in Ajax select HJ.
    My application is available on http://apex.oracle.com/pls/apex/f?p=33829:1:2010637670427735:

    Appreciate any help on this

    Thank you
    Dembélé

    See this example:

    http://Apex.Oracle.com/pls/OTN/f?p=31517:119

    and this blog:

    http://deneskubicek.blogspot.com/2009/06/how-to-debug-Ajax-and-on-demand.html

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • Using AJAX code for the conditional selection list.

    Hello

    I use AJAX code for the first time, I have no knowledge in java, I got the code from this forum and try to manipulate my requirement.

    My requirement is that I have two selection lists, host_name) 1 and 2) database_name.
    As soon as I pick/choose the value of host_name select list, I need to fill in only the databases on this particular host. I don't want to send the page for this action.

    Here is the code, thank you if anyone can help.


    On request the code application process:
    -----------------------------------------------------
    declare
    number of l_counter;
    l_o_name varchar2 (2000);
    Start
    owa_util.mime_header ("text/xml", FALSE ");
    HTP.p ('Cache-Control: non-cache');
    HTP.p ('Pragma: non-cache');
    owa_util.http_header_close;
    HTP. PRN ("< select > '");
    for rec in (select "ORA_DATABASES_VW". "' Database_name ' as 'database_name ',.
    'ORA_DATABASES_VW '. "" DB_ID "as"DB_ID ".
    of 'ORA_DATABASES_VW '.
    where 'ORA_DATABASES_VW '. ("' HOST_NAME ' =: TEMP_ITEM)
    loop
    HTP. PRN ("< option value ="' | rec.db_id |) '">' || Rec.database_name | ("< / option >");
    end loop;
    HTP. PRN ("</select > '");
    end;

    Header HTML on this page:
    =================
    < script language = "JavaScript1.1" type = "text/javascript" >

    function get_List_XML (source_item, target_item) {}

    var v_Target = html_GetElement (target_item);
    var v_Source = html_GetElement (source_item);
    var ajaxResult = new htmldb_Get (null, & APP_ID, 'APPLICATION_PROCESS = POPULATE_LIST_XML', 0);
    ajaxResult.add ('TEMP_ITEM', source_item.value);
    var v_result_xml = ajaxResult.get ('XML');

    If (v_result_xml & & v_Target)
    {
    var options_Contents = v_result_xml.getElementsByTagName ("option");
    v_Count = options_Contents.length;
    v_Target.length = 0;

    for (var i = 0; i < v_Count; i ++)
    {
    var v_opt_xml = v_result_xml.getElementsByTagName ("option");
    appendToSelect (v_Target, v_opt_xml.getAttribute ('value'), v_opt_xml.firstChild.nodeValue)
    }
    }

    }
    function appendToSelect (target_item, option_val, option_content) {}
    var v_Opt = document.createElement ("option");
    v_Opt.option_value = option_val;
    {if (document. All)}
    target_item.options.Add (v_Opt);
    v_Opt.innerText = option_content;
    } else {}
    v_Opt.appendChild (document.createTextNode (option_content));
    target_item. AppendChild (v_Opt);
    }
    }
    < /script >


    Attribute of the form in the host_name column element. P935_INSTANCE_DB_NAME is my page for database_name.
    OnChange = "get_List_XML (this,"P935_INSTANCE_DB_NAME").

    Feel free to mark the answers useful or correct ;)

Maybe you are looking for