One select list with multiple LOV's (LOV based on how page was called)

APEX 4.0.2
I've a DML form page from a report on which I need a single select list item to have a differing LOV based on how the form page was called.
The calling page (report), contains an edit link column and a create button. Depending on which is selected, I wish the LOV for my select list item to change. The idea behind this is that if someone creates a new entry, I want to constrain the select list to a subset of rows of a table query populating the LOV. On the other hand, if an existing item is edited, I want the select list LOV containing all rows of a table query populating the LOV.
What I've tried...
- Duplicates of select list item each triggered to render based on an arbitrary value set when either "create" or "edit" are selected. This did not work because the item was part of DML and would not allow replication on the same page.
- Logic in the LOV sql statement controlling which sql was to be run based on an arbitrary value set when either "create" or "edit" are selected. This did not work as logic is not allowed in LOV sql statements.
Any thoughts? Many Thanks!
Paul

Hello Patrick!
Thanks for responding - Love your captcha plugin!
Anyway, these are the two dynamic LOV's. The first I have in play right now (when creating new records). I need to have the other for existing record modifications.
LOV #1
select stock_no d, stock_no r
from   [email protected]
where  status like '%Awaiting Transfer%'
or     status like '%On Hold%'
order by 1LOV #2
select stock_no d, stock_no r
from   [email protected]
order by 1As I mentioned, I attempted to use plsql logic in the query to trigger one or the other based on a value set when the user either clicked an edit link or a create button but couldn't get the dynamic LOV to commit with that extra code in it.
Thanks!
Paul

Similar Messages

  • Select list with multiple columns

    I want to create a select list with multiple column option. What are the options. Any developments in apex 3.0.1 ? Thanks in advance. I tried the tutorials by Kubicek.
    I am kind of stuck to see the function entry inside LOV definition returns a error.

    Still really one column.
    If they need to be independent then you've got to have three selection lists.
    %

  • Creating Select List with multiple columns

    I want to create a select list with multiple columns. I followed the demo application model described in the by Denes Kubicek (Currently my reference for APEX !!)
    The code is as follows:
    CREATE OR REPLACE FUNCTION getcrops(p_cropid IN NUMBER)
    RETURN VARCHAR2
    IS
    v_cropid VARCHAR2 (400);
    v_fcode VARCHAR2 (400);
    v_product VARCHAR2 (400);
    v_var VARCHAR2 (400);
    v_fname VARCHAR2 (400);
    v_acres VARCHAR2 (400);
    v_style_start VARCHAR2 (400);
    v_style_end VARCHAR2 (400);
    v_return VARCHAR2 (400);
    BEGIN
    FOR c IN (select "CROP"."CROPID" as "CROP ID",
         "CROP"."FIELDCODE" as "FIELD CODE",
         "CARROTPRODUCTLIST"."CARROTPRODUCTNAME" as "PRODUCT",
         "VARIETYLIST"."VARIETYNAME" as "VARIETY",
         "FIELD"."FIELDNAME" as "FIELD NAME",
         "CROP"."SIZEINACRES" as "ACRES"
    from     "FIELD" "FIELD",
         "CARROTPRODUCTLIST" "CARROTPRODUCTLIST",
         "VARIETYLIST" "VARIETYLIST",
         "CROP" "CROP"
    where "CROP"."CARROTPRODUCTTYPE"="CARROTPRODUCTLIST"."CARROTPRODUCTID"
    and     "CROP"."VARIETYID"="VARIETYLIST"."VARIETYLISTID"
    and     "CROP"."FIELDID"="FIELD"."FIELDID")
    LOOP
    v_cropid := TO_CHAR (c.'CROP ID', 'FML999G999G999G999G990');
    v_fcode := c.'FIELD CODE';
    v_product := c.'PRODUCT';
    v_var := c.'VARIETY';
    v_fname :=c.'FIELD NAME';
    v_acres :=c.'ACRES';
    FOR i IN 1 .. 12 - LENGTH (c."CROP ID")
    LOOP
    v_cropid := v_cropid || ' ';
    END LOOP;
    FOR i IN 1 .. 12 - LENGTH (c.'FIELD CODE')
    LOOP
    v_fcode := v_fcode || ' ';
    END LOOP;
    FOR i IN 1 .. 12 - LENGTH (c.'PRODUCT')
    LOOP
    v_product := v_product || ' ';
    END LOOP;
    FOR i IN 1 .. 12 - LENGTH (c.'VARIETY')
    LOOP
    v_var := v_var || ' ';
    END LOOP;
    FOR i IN 1 .. 12 - LENGTH (c.'FIELD NAME')
    LOOP
    v_fname := v_fname || ' ';
    END LOOP;
    FOR i IN 1 .. 12 - LENGTH (c.'ACRES')
    LOOP
    v_acres := v_acres || ' ';
    END LOOP;
    v_return := v_cropid || v_fcode || v_product || v_var || v_fname || v_acres;
    END LOOP;
    RETURN v_return;
    END;
    I created this anonymous Pl/SQL function at a application level ..Then I followed up to create a select list with a function inside. However I could not create select list with the command suggested in the demo which is
    select getcrops(cropid) d, cropid r from crop;
    APEX (2.1) returns a error message. What am I missing ? Should the function be called from somewhere else after creating a regular select list..? Where the functions (Pl/SQL) should be ideally stored for application level access..? and for across application level access ? How can I check the function works good. Help is appreciated.

    Still really one column.
    If they need to be independent then you've got to have three selection lists.
    %

  • Selection list with multiple columns

    How can i create a selection list with multiple columns?

    Still really one column.
    If they need to be independent then you've got to have three selection lists.
    %

  • How to access the value of fiedl ( select list with redirect )

    WE created one report and form. When i click in the edit button of the report
    for the specific record ; the system go automatically in the form
    and show me all the information. In my form ia have some fields ( select list with redirect ) in this way i store the key but i can see the description.
    I want to control the delete operation in checking the value of some field
    in my form. How can i do that. When i verfy the content with SESSION
    my variable are empty
    Thanks
    Marc Fortin

    Hello Larry,
    You can use a select list with submit and create a branch to the page you want to go to.
    Hope that helps.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • Associating a process with a 'select list with submit'

    Hi,
    In a tabular form I have 2 'select list with submit'. If a row is selected in the tabular form I need the following functionality from each of the select lists:
    Once a value is selected from the list a process will get excuted which will update a column of the checked row in the database table with the selected value from the list.
    My question is,
    1. How can I associate an 'after submit process' with the 'select list with submit'?
    2. Can I store the selected value in a variable which I can pass as an input parameter to a PL/SQL body?
    Regards,
    AM

    Hi,
    Please see my requirement below.
    I have a 'select list with submit' say P1_Select in a Tabular form Page. I want to create an after submit process (PL/SQL Process) which will take the selected value from the select list as input parameter and perform an update function for the checked row with that value.
    I'm trying give a feel the procedure:
    CREATE OR REPLACE procedure "P_REJECT"
    (p_message IN VARCHAR2 default Null)
    is
    begin
    FOR ii IN 1 .. APEX_APPLICATION.G_F01.count
    LOOP
    UPDATE NI SET NI.STATUS_NI = 'WCONF', NI.NI_Message = p_MESSAGE
    WHERE NI.NI_REF = APEX_APPLICATION.G_F01(APEX_APPLICATION.G_F01(ii));
    END LOOP;
    end;
    As suggested by Flavio I created the conditional 'after submit' process where I'm making a call to the above procedure.
    1. I am not sure how to pass the selected value as a parameter to the proc.
    2. 'request = value, where the value is the string literal P1_SELECT'.... Could not really figure out the meaning of string literal P1_SELECT
    Regards,
    AM

  • Select list with submit using on a dynamic report

    Hi! I'd like to know how can I create a Select list with Submit using the HTMLDB_ITEM API.
    I know there's an API named HTMLDB_ITEM.SELECT_LIST_FROM_LOV(), but I'd like to know how can I reproduce in there the submit everytime the user changes a value.
    Thanks!

    Hi! I've discovered there's a parameter on this function that allows me to include a javascript like the example below:
    select HTMLDB_ITEM.SELECT_LIST_FROM_LOV(3, ctr_id,'LOV_COUNTRIES','onChange=javascript:doSubmit()','NO)
    from XXXX;
    The thing is I don't know how exactly this javascript:doSubmit() works, because it works different than creating a select list with submit item.
    If I create on a page a simple "select list with submit" item, and if I run the page, after changing the value of the select list it refreshes the page but it doesn't erase the values inserted on the other items. But if I have this HTMLDB_ITEM.SELECT_LIST_FROM_LOV function, after changing the value of the select list it refreshes the page but it erase the values inserted on the other items and recovers the old values..
    I really need your help on this.
    Thanks in advance :-)

  • Update select list with dynamic LOV

    How exactly do you do this?
    Currently I have a text field which the user may enter a product type and a button when click. It would populate the select list with the product names that associate with that product type...
    My lov would retrieve the product type value text field(:P1_t_prod_type) and get products names by type
    select t_prod_name A , t_prod_name B
    from t_prod_items
    where t_prod_type = :P1_t_prod_type
    order by 1Im kind of stump on is setting up my dynamic action to "set value" to the select list. As nothing seems to be appearing.

    product type is a numeric value that can be a wide numeric range. (I don't know why the column is named like that. Sorry for forgetting to mention that)
    Well I don't think i should submit the page? because after the list box is filled with product names. the user can then select one of those names from the list box and continue completing the rest of the form. After all that the page would then be submited. (Well that's how i imagine it to work...)
    Wouldn't i run into problems if i were to submit the page twice... like lost entry in other text fields if the user were to skip that part at the start.

  • Chart based on Select list with submit Lov problem

    Hi,
    I have one page with interactive report showing username with links, date and
    database actions.
    Another page contains one region having flash chart based on select list with submit Lov.
    The lov is created by dynamic query.
    Every time when i click the 1st page report link, the 2nd page lov is populating the value automatically. But the problem is chart displays NO DATA FOUND message though the LOV has many values.
    I don't want to display any null values so set to NO for LOV
    I tried to write Before header computation (PL/SQL Function Body) to set the lov value, but the query is displayed as such.
    I don't want to assign any static default value also as the values are dynamic for every link.
    The following is my Before header computation of Select list with submit (Item name is p11_schema). (PLSQL Function Body)
    begin
    if :p11_schema is null then
    return 'select distinct owner schema1, owner schema2 from auditing
    where access_date=' || :p11_access_date
    || ' and username=' || :p11_username
    || ' order by owner';
    end if;
    end;
    This is my chart query.
    select null link, obj_name label, sum(sel_count) "Select", sum(ins_count) "Insert", sum(upd_count) "Update", sum(del_count) "Delete" from auditing
    where username=:p11_username
    and access_date=:p11_access_date
    and owner=NVL(:p11_schema, OWNER)
    group by owner, obj_name
    Example: If there more than one records in the lov, the graph should display the 1st record. When i select another record, the chart accordingly display the selected values. But inially it should not display "NO DATA FOUND" message.
    I tried using all the combinations of computation type for the lov, SQL query ( I could not use if conditon then), PLSQL expression, PLSQL function body. But it does not work out.
    Can anyone please help me out.
    Thanks.

    Hi Scott,
    Thanks for your reply.
    I found out the solution for this problem as below.
    But i did it in different way to tackle the dynamic query wich returns more than one record using rownum always the 1st record when it is empty instead of assigning constant (static) value like '1'. And i am returning LOV itself for both null or not null condition as below.
    Declare
    q varchar2(4000);
    begin
    if :p11_schema is null then
    q:='select distinct owner schema from auditing';
    q:=q || ' where username=:p11_username ';
    q:=q || ' and access_date=:p11_access_date ';
    q:=q || ' and rownum<2 order by owner';
    Execute immediate q into :p11_schema USING :p11_username, :p11_access_date;
    end if;
    return :P11_SCHEMA;
    end;
    Thanks.

  • Item(select list) with LOV and Report with link = changed value item

    Hello,
    On one page I have:
    - Item 'P_name' (select list) with LOV to select name of a person;
    - Items 'factory' and Report 'factory'(standard created with 'Form with Report' on the same page).
    Situation:
    All works fine. I selected first a LOV Item 'P_name' (say 'Jane'). But....
    Only when I select a record (to change the values) from the report 'factory' then LOV Item 'P_name' become empty. Report used a link to the same page to fill the report items 'factory' and make also the LOV item empty.
    Question:
    I have made a process that write the name 'Jane' to table.
    I see two possibilities:
    - LOV Item value => fill the LOV item with 'Jane' from the table before region. Is this possible?
    - Report => What is the buttonname of reportlink? I can use this name in the processes.
    Thanks Walter!

    1) what i meant was for you to test this ridiculously huge LOV outside of htmldb, but it occurred to me last night that you could, in fact, be hitting a limit of ours. after some poking around, i have confirmed that. select list items in htmldb are currently limited to 10,000 rows. this was initially done for performance reasons, but they're now opening up the restriction. if you really need to work with that many rows where the user is allowed to pick from a set of values, consider using a popup item type instead. it'd help your app performance as well (in my test cases, it stank to have to wait for my 10k select list rows to come down to my browser).
    2) sorry to not have been more clear about this, but when you set your item's "Source Type" back to "Database Column", you'd have to specify that column in the "Source or value expression" field. also, you can't put a sql query into that "Post Calculation Computation" field. as i said before, "you can take a look at the attribute-level help for that field to see implementation examples."
    3) stick with "Always..." for now if you're using our auto-dml process(es)
    regards,
    raj

  • How create LOV(select List) with all LDAP users

    Hello,
    I am trying to create a selected list with all the users in my LDAP, note my LDAP is synchronized with my OID.
    Any suggestions, I'm searching the the pl/sql statment?
    Thanks
    Hussam

    Hi Hussam,
    Take a look at my comments in the following two threads -
    Re: LDAP
    Re: Cookie And LDAP
    The two different threads discuss the methods I use to do what you want to do (so you really need to 'combine' the two different threads).
    Hope this helps

  • List with multiple selection

    Hello;
    I seek a code to implement a list with multiple selection for a browser Web (HTML is imited).
    I have a list containing of the years, the user can select one or several years and I created dynamically a array : for each year a column.
    Thank you;

    Look at JList.
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JList.html
    � {�                                                                                                                                                                           

  • How to select value from list with multiple selections ?

    HI,
    i have a list with multiple selections where i show email address retrieved from database.
    what i want to do is to send the selected email address to the invoiceedit.jsp.
    please look at the following code which gives you the better idea.
    <td class='smalltext'><select name="email" size="3" multiple="multiple">
       <% 
       Connection conn = null;
       Statement stmt = null;
       Statement stmt_contactperson = null;
       Statement stmt_address = null;
       try{
          conn = getREConnection();
           stmt = conn.createStatement();
       ResultSet rs = null;
       rs = stmt.executeQuery("SELECT PROPERTYID, VALUE FROM PROPERTIES WHERE ENTITYID="+ g_strGroupID+" AND NAME = 'invoice_default_email'");
       int numofrows = 0;
       while(rs.next())
               %>
       <option value="<%= rs.getString("VALUE") %>" selected="selected"> <%= rs.getString("VALUE")  %> </option>
        <%
           }//end of while
          %>
         </select>
        <a href="invoiceedit.jsp?entityid=<%=g_strGroupID%>&add=1"><font color="#000000">Add</font></a>
         <a href="invoiceedit.jsp?entityid=<%=g_strGroupID%>&email_to="><font color="#000000"> Edit</font></a> </td>thanks

    Use a form button instead of a link so that you can send it as a request parameter to the server. In the server side just use HttpServletRequest#getParameterValues() to obtain all values for the given parameter name. If you really need a link rather than a button, then use Javascript to submit the form on click of the link.
    That said, your design is bad. Java code belongs in Java classes, not in JSP files. Database access logic belongs in a DAO class. Business and controlling logic belongs in a Servlet class. Only presentation logic belongs in the JSP file. Avoid scriptlets as much as possible and use JSP EL and/or JSTL instead.

  • [svn:fx-trunk] 10943: Fix to dragging from List with multiple-selection

    Revision: 10943
    Author:   [email protected]
    Date:     2009-10-08 15:46:27 -0700 (Thu, 08 Oct 2009)
    Log Message:
    Fix to dragging from List with multiple-selection
    - The fix is to postpone the selection commit until we make sure the user has not started a drag gesture.
    - Exclude the dragEnabled, dropEnabled, dragMoveEnabled properties for DropDownList
    QE notes: None
    Doc notes: None
    Bugs: None
    Reviewer: Deepa
    Tests run: checkintests, mustella List, DropDownList
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownList.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as

  • Dynamic select list with one static 'not_listed" option

    Hi guys,
    I want to create a dynamic select list with one static 'not_listed' option.
    One possible alternative is to add the 'not_listed' record into database, but I really dont want to go that way unless there is no other way around.
    Can anyone shed some lights on this?
    Many thanks,
    William

    As usual : "It depends"...
    If you have a foreign key defined on that field, Scott's reply won't work - unless you define '0 - Not listed' in the database. You can use selec 'not listed' d, to_number(null) r from dual though...
    Another - more declarative way - is in the on 'Edit Page Item' page, in the 'List of Values' region set 'Display Null' to 'Yes' and 'Null Display Value' to ' - Not listed - '.
    Roel

Maybe you are looking for