Fetch - populating a selection list

Is it possible to create a fetch mapping that populates a selection  list with different values for the display value and the key  value?  You can do this in Service Designer for predefined SQL  queries.
I need to perform a dynamic query that populates a  selection list with display values users will understand, but whose  underlying values are really unique identifiers.
In the end I'm  trying to build a hierarchical series of selections where the value of  the most recent selection becomes a parameter to the next query.
I  could probably perform the fetch and then manually iterate over the  result set in javascript, adding the values to the selection list, but  I'm wondering if there is an easier way.
I'd like to be able to do something like the following, but I don't think its possible.
<map name="M1">
<entry Field="BETA_ID_NEW.DepartmentBranch.Name" Column="DisplayName"/>
<entry Field="BETA_ID_NEW.DepartmentBranch.Value" Column="Value"/>
</map>

Unfortunately, you are correct, there is no way to do this except by hitting it over the head. But your proposed solution is interesting -- if it worked at all, I suspect fetch would populate two drop-down/select lists, rather than 1. (I've tried this, but actually doing two fetches -- very wasteful.) But then, you wouldn't have to iterate through the entire list, just set the selected index for the second (value) list, not writeable by the user (hidden?), to the index just selected by the user for the f

Similar Messages

  • Populating a SELECT list from an Oracle Table

    Hello,
    I would like to populate a second SELECT list on
    a web page based on the selected value in the first
    SELECT list. I would like to take the value
    that the user selects in the first SELECT list and
    use it in a WHERE clause to bring back distinct
    values to display in the second SELECT list.
    I would like to do this all on a single page. As
    soon as the user selects a value in the first SELECT
    list, then the correct values retrieved from the
    database would appear in the second select list.
    Is this possible? Do you have sample code or ideas??
    I can write JavaScript to get the selected value, but
    I cannot get to Oracle data from the JavaScript environment.
    I can write PL/SQL or Java procedure to access
    Oracle data, but I cannot make the complete connection.
    Help, please.
    thanks
    paul

    Unless you can get every combination back in the first SQL statement, you'd have to do something along the lines of
    - Have the JavaScript submit the page as soon as the first pull-down is selected
    - Have the response be a page identical to the first page, but with the second pull-down populated.
    The other option would be to have a Java applet that can make the second query and return results. Since applets can't connect to the database by default, you'd have to have an app server that would do the actual query.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com/askDDBC

  • Dynamic Population of Select List

    I am stuck in a very frustrating situation at present, I need to dynamically populate select lists based on user choices.
    There are three drop down menus, only the first one is pre-populated with the other two populating upon user selection of the previous one. I am using JSP and JavaScript in conjunction. I need to make a function call to a back-end library which exists on a servlet to get the data for the 2nd and 3rd drop down menus, the parameter for the function being the user selected option in the 1st drop down menu.
    I know I cannot use the JavaScript "onchange" event handler as that won't help me call the back-end library functions. One way that I think is feasible at the moment is to do page refreshing, i.e. include other JSP's in one main JSP and refresh them as soon the user makes a choice. The other way is to embed an applet in a JSP page and use the JComboBox from the Swing libraries to detect events and make HTTP connections to servlets. I believe there is a possibility of using Struts to do this as well. Can someone tell me which would be the best method to use and a general overview of how to go about using it? I am also open to other alternatives...
    Thanx for any help in advance

    this can be done in two ways.
    one way:- try generating a hidden form fields with the values comma seperated.
    like <input type='text' id= id1 name = select1 value = 'coma seperated list of second select values' >
    on on change event you can get the list of values which you need to populate in the second select box. generate the options dynamically by splitting the coma seperated list into the second combo.
    second way:- while loading the jsp store all the second select box coma seperated list in java script array. and based on the change event of first select box get the corresponding values from the array and split them and generate the options dynamically and populate the second select box.
    I guess this way you can solve your problem.
    write back to me on [email protected] if you need code snippets.
    all the best
    kiran J

  • Dynamic Population of Select List    code

    I have two select box's in jsp.
    if i selct one item on chane method i have to
    pupulate them in second selectbox.can any body have
    code for that

    I am not sure if you are using database for retrieval but in such a scenario you can do this:
    in case the option value/name for your first select box are unique, you can store this value in a particular variable and write another query to retrieve the value which you require in the select box in an Array by using the variable and finaly iterating through the array to have the select box populated.
    Hope you understand this and it helps you out.

  • Select List Population

    I have two select lists.The first one holds the column names of a table and the second one should populate all the distinct values of the column selected in the first list.
    In the second select list I have written a query like
    SELECT DISTINCT V('P4_TOP_SEARCH') p,V('P4_TOP_SEARCH') r FROM INTERVIEW_DETAILS
    where 'P4_TOP_SEARCH' is the session state value and is a column of a table.
    I am not getting values but the session state value is populated in select list
    Is there any way to do it.

    Is there anyone to help me out.

  • DYNAMIC LOV FOR SELECT LIST

    hi to all,
    i've a question regarding lov query based select list:
    For a certain user i need that the lov display a list
    if app_user = BACK_OFFICE I NEED THAT ther query on wich is populated the
    select list is qry 1.
    if app_user is another (consultant) i need query 2 for populating the select list
    1) select name|| ' ' || fname D, id K from partner
    2) select name|| ' ' || fname D, id K from partner WHERE UNAME=(:APP_USER)
    Any solutions would be greatly appreciated.
    Another solution would be to have 2 different apps (one for back-office, one for external consultant), but there i should always duplicate all changes to the second one, loosing a lot of time.
    Now thinking as well to use hidden fields.
    If not clear enough please ask me.
    Thanx a lot.
    Message was edited by:
    Marcello Nocito

    I think one solution wold be to create two different named querys, one containing query 1 and the second query 2. Than u must create an Application Item(like a session variable) in wich u will store you condition. If you want to use the app_user variable u allready have it so you don't need to create it any more. On your page where u want to display the different select list u create two items, one with the query 1 as source and a second item(select list) having the source query 2. Then you must add a condition display on both of them like. Item one is displayed when Value of Item in expression 1 equals expression 2. And you pust :APP_USER in expression 1 and BACK_OFFICE in expression 2. And for the other item, that contains query 2, you put the opposite condition Value of item in expression 1 is not equal to expression 2, and expression 1 is :APP_USER and in expression 2 is BACK_OFFICE.
    Hope this helps.
    Florin

  • How to implement casading select lists  in ADF?

    I have three select list, when select list 1 is changed appropriate value needs to populated in select list 2 and similarly when select list 2 changed, select list 3 should be populated. I'm a newbie to ADF, any ideas are appreciated. Also, really appreciate if someone can point some sample application which illustrates some of these features.
    Regards,
    Surya

    This will help http://tinyurl.com/26b735s

  • How to acquire display value of selected item on select list? Or...

    I have a select list generated from a SQL query that I need to get the display value from.
    Ideally, the display value and the submitted value of the select list would have been the same, but I can't seem to get APEX to allow populating a select list's display value and submitted value fields with the same database column.
    If you have any idea how to do either of the above, I'd love to hear from you here!
    Cheers,
    Ben

    you forgot the extra quotes I guess:
    declare
    l_sql VARCHAR2(4000);
    begin
    l_sql := 'SELECT product_name,project_name,information_access_system,dataset_name FROM v_dms_product WHERE product_name = ''' || :P24_CHOOSEPRODUCT || ''' GROUP BY product_name,project_name,information_access_system,dataset_name';
    return l_sql;
    end;

  • SELECT LIST WITH SUBMIT NOT POPULATING

    I have 3 fields; They are ID, Shortname(PRIMARY KEY), Longname. Longname is a select list with submit based on an lov (called system_longname description) that has a return value of ID. I need to select a value (longname) from that list that will populate automatically the ID and Shortname fields. This is the code I'm using for ID and Shortname, which are both text boxes. The view VSYSTEMS is where the lov is getting it's values.
    'SELECT ID FROM VSYSTEMS WHERE ID = :SYSTEM_LONGNAME DESCRIPTION';
    'SELECT SHORTNAME FROM VSYSTEMS WHERE ID = :SYSTEM_LONGNAME DESCRIPTION';
    Can anyone help me? I keep getting these error messages: invalid SQL statement or SQL command not properly ended.

    Matthew,
    Is this a follow-up to Automatic field population by selecting a LOV ?
    What is the purpose of 'DESCRIPTION' at the end of each query?
    Scott

  • Automatic row fetch based on a select list

    db11gxe , apex 4.0 , firefox 24 ,
    hi all ,
    i want to do automatic row fetch when the value of a select list changes ?
    but first i should ofcourse create a tabular form to fetch the data into it , but what i want is ,if i fetch 2 rows then the report contains only two rows , if i fetch 3 , the report contains only 3
    , if i fetch nothing , the report has nothing ?
    thanks

    Assuming all your page items are on separate rows, under your Page Attributes Header and Footer section, add the below function under Header Text:
    <script>
    function f_toggleNM() {
       // if P2_ATTACHMENT_TYPE value is D, then show row holding P2_CUSTOM_NAME and P2_CUSTOM_MSG. Else hide them
       $f_Show_On_Value_Item_Row('P2_ATTACHMENT_TYPE', [ 'P2_CUSTOM_NAME', 'P2_CUSTOM_MSG' ], 'C');
       // if P2_ATTACHMENT_TYPE value is C, then show row holding P2_DEFAULT_NAME and P2_DEFAULT_MSG. Else hide them
       $f_Show_On_Value_Item_Row('P2_ATTACHMENT_TYPE', [ 'P2_DEFAULT_NAME', 'P2_DEFAULT_MSG' ], 'D');
    </script>Under Footer Text, add the below:
    <script>
    f_toggleNM();
    </script>And on the P2_ATTACHMENT_TYPE item, Element tab, HTML Form Element Attributes, add below:
    onchange="f_toggleNM();"Hope this helps. Thanks!
    JMcG

  • Automatic population of multiselect based on select list

    Hi,
    I have an issue in populating in multiselect from the data in select list.
    Let me take an example and explain.
    I have 3 tables: Employee, Department and a linking table for employee and department.
    The select list contains employee and department is a multiselect. On selection of Employee, all the departments should be displayed and the department to which employee belongs(which is taken from the linking table) should be selected (High-Lighted). How do I do this?

    Hi,
    I am trying this on three tables…DEPT, EMP, DEPT_EMP wit a select list(P1_EMP) and a multiselect (P1_DEPT).
    Dept has two columns (ID and Deptname). It has two rows.
    DEPT
    Id |Deptname
    1. HR
    2. OPERATION
    Emp has two colums (ID and Empname)
    EMP
    Id|Empname
    1. Jason
    2. Pam
    Dept_Emp has three columns (ID, Employee ID which refers to the EMP.ID, DeptID which refers to the DEPT.ID)
    DEPT_EMP
    Id| Employeeid | DeptId
    1. 1 1
    2. 2 2
    As shown , Jason belongs to HR and Pam belongs to OPERATION.
    I have tried the following steps:
    1. OnChange of Employees drop down list(P1_EMP), I have called a javascript function.
    <script type="text/javascript">
    function getDepartments(filter, listName)
    var employee = filter.value;
    var list = document.getElementById(listName);
    var listvalue = list.value;
    var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=GET_DEPARTMENTS_FOR_EMP',0);
    get.add('G_EMPLOYEE', employee);
    ret = get.get('XML');
    if(ret)
    var s = ret.getElementsByTagName("select");
    if(s){
    var o = ret.getElementsByTagName("option");
    var oCount = o.length;
    list.options.length = 0;
    var i=0;
    while(i<oCount)
    var l_Opt_Xml = o [ i ];
    appendToSelect(list, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue);
    i=i+1;
    list.value = listvalue;
    if (list.selectedIndex == -1)
    list.selectedIndex = 0;
    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>
    2. The Javascipt function calls in a application process(GET_DEPARTMENTS_FOR_EMP) and I have also created an application item(G_EMPLOYEE) for the same.
    declare
    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('<data>');
    htp.prn('<select>');
    for rec in (
    select distinct "DEPT"."Deptname" d, "DEPT"."ID" r
    from "DEPT","DEPT_EMP "
    where " DEPT_EMP "."DeptID"="DEPT"."ID"
    and " DEPT_EMP "."EmployeeID"=:G_EMPLOYEE
    order by 1
    loop
    htp.prn('<option value="' || rec.r || '">' || rec.d || '</option>');
    end loop;
    htp.prn('</select>');
    htp.prn('</data>');
    end;
    The employee multiselect(P1_EMP), initially has a “Select employee”. Upon selecting Jason, it should show, all departments and highlight HR. The same for Pam.
    But it is showing only the departments for the employee. If I modify the application process query to show all employees in that department, how do I highlight only that employee?
    Edited by: 841762 on Mar 7, 2011 1:50 AM

  • Dynamic Select List population

    I have 2 lists on my form.
    First one is populated from LOV...based on the value that is chosen in the first Select List I would like to populate the second LOV. Is this possible?
    for example...First Select List has Company Id, Company Name. So to populate the second one I want to use the following query: select event_type_id, event_type_dec from event_type where company_id = "company_id from first select list".
    Thanks.

    Hello,
    Take a look at this
    How to make LOV's reference other LOV's on the form page
    Carl

  • Select an Entry in a (populated) Select List

    Hi,
    I have got a table PERSON (id, name, firm_id) and a table FIRM (id, name).
    I have got a report that shows me all persons: name, firm.name (where PERSON.firm_id = FIRM.id)
    When I edit a person, the detail page opens. I want to see the name of the firm instead of the firm_id. Therefore I added a select list where the user can choose a firm. The list is populated correctly with all firm names (and their IDs):
    select name d, id r from firm order by 1
    So far so good, but: The selected entry in this list is always the first one (<please select a firm>).
    What do I have to do that the select list shows me the correct firm? In other words: How do I tell the select list, what the firm_id of the shown record is?
    Step 2: When I click the save button: How do I tell the application that PERSON.firm_id has to be taken from the select list?
    Thanks for any help,
    -- zebu

    Thanks Dietmar
    When creating the application I have selected "Report and Form" and added both tables (FIRM and PERSON), both as top-level pages (i.e. none is subordinated to the other).
    What I got is 4 pages (the two forms on rows 2 and 4 are a little bit indented):
    Page     Page Name     Page Type     Source Type     Source     
    1     FIRM     Report     Table     FIRM
    2     FIRM     Form     Table     FIRM
    3     PERSON     Report     Table     PERSON
    4     PERSON     Form     Table     PERSON
    I all other steps I have choosen the default. At the end, the application builder shows me 5 pages: The 4 above plus the login page.
    Remark: Up to this point everything was automatically generated. This changes now:
    When I look at the PERSON Form now, I have the attribute PERSON.firm_id. That works perfectly. But I want the select list with the firm names (from the FIRM table). Therefore, in the Items list of the PERSON-Form-Page I delete the "firm_id - text field" and replace it with "firm - select list". The select statement is: select name d, id r from firm order by 1.
    In the "Edit Page Item" for the select list I wanted to tell the application, which of the loaded values shall be selected. But I don't know where and how.

  • Populating select list in a JSP with enumeration values

    I'm working on a JSP in which I need to populate a select list with enumeration values.
    Everytime I'm trying to insert these values (using enum.nextElement()) in a select box only the first enumerated value gets inserted correctly, the rest of the values shows up outside the select list. I would appreciated any help...thanks!!!

    I'm not exactly sure how your generating your list to begin with, however the following code will work:
    <form>
    <select>
    <%
         java.util.Vector v = new java.util.Vector();
         for(int i=0;i<12;i++){
              v.addElement(new Integer(i));
         java.util.Enumeration enum = v.elements();
         while(enum.hasMoreElements()){
         Object obj = enum.nextElement();
         out.println("<option name='"+obj+"'>"+obj+"</option>");
    %>
    </select>
    </form>Anthony
    BTW does anyone know why the greater than symbol never renders properly in these forums when text is encapsulated in the code tag?
    pre:
    >code:
    >

  • Select list populated with ldap group membership attributes

    Is it possible to query an LDAP group and retrieve all the members of the group?
    For example, if I have an LDAP group with members' login name, I want to retrieve all login names and populate a select list so the end-user can choose a login name from the group.
    Thanks, alan.

    The problem is the second query. I would guess that the TO_CHAR(co) is not unique for each account, but is the same for the accounts. And as the second item in the select-list is the listitems values, all your listitem-entries have the same value. therefore, of you select any entry, the list will always go the the first entry again.
    Adjust your query.

Maybe you are looking for

  • Need your help on interactive report

    hi all I have generated a report(below one) ,actually i need EKORG,EKGRP,NETWR in basic list i am not getting any value in NETWR field and also I need MAKTX field in secondary list but i am not getting any value in that field  what can i do ,please s

  • How do i delte more than one image at a time from all images folder on iMac

    i have 7000 images in the my images folder, how can I delte them all at once?

  • Error while rebuilding webdynpro application

    Hi, When i am building my application i am getting two errors. 1 . This compilation unit indirectly references the missing type com.sap.tc.logging.Location (typically      *some required class file is referencing a type outside the classpath)     * 2

  • Error message when trying to connect to an FTP address

    I am trying to connect to an FTP address. When I use Finder > Go> Connect to server... and type in the FTP address I want and click on "connect", I get an error message: The operation cannot be completed because one or more required items cannot be f

  • Tips and Tricks

    http://www.youtube.com/watch?v=OkiLzQ2KjP4 So that was my second time using after effects but I don't know how I could improve it! How do I make the muzzle flare have the same quality as the original video because the muzzle flare quality is in 720p