Select list based on LOV - and allowing new values

Hi All,
I have a page that has a select list based on a dynamic list of values. I wanted to test out how the system was working, so I truncated all of my tables, and now my select list is blank (which makes sense). The problem is that I can't type anything into the select list. How can I make it so that if there isn't a value returned from the query that populates the LOV, I can just type one in? This also goes further in that if the value I wanted isn't already in the db, how does the user add in another value?
Thanks in advance,
Corey

Hello,
Well as you now know HTML based select lists don't work like that, that widget is called a combo box and there will be built in combo boxes in APEX 3.0, it's a fairly complex dhtml widget.
What you might want to do is provide a text item next to your select box and an Add New Value Option in your select list.
Carl

Similar Messages

  • Select List (based on LOV) query problem

    Hello experts! I have a small problem here, which I can't seem to overcome.
    I have a page item (select list based on LOV), which is based on a query. The query returns all potential employees of a department that are responsible for a certain duty. So far so good!
    The problem is that there are two departments, which should not only see there own employees but also the name of the employee that has carried out a certain task. However, due to my query, the name of that person is not displayed - only the pk is returned.
    Do you have a recommendation how I display all employees of a specific department and have additional values translated as well?
    My query is as follows: select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter where cnt_bearbeiter in (SELECT
    CNT_REGIERUNGSBEZIRK FROM TBL_REGIERUNGSBEZIRK) union select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter where int_behoerde in (SELECT
    CNT_REGIERUNGSBEZIRK FROM TBL_REGIERUNGSBEZIRK where STR_REGIERUNGSBEZIRK = lower (:app_user)) whereas :app_user holds the information of the department.
    Any hint is appreciated!
    Many thanks,
    Seb

    Okay, I just had the right idea and it's working well! Sorry for posting!
    I return the name of the employee that has edited a dataset and simply add all others of the logged on department! Really easy! Should have thought of that before posting! ;-(
    The correct code is select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter a, vt_tbl_punktdaten b where a.cnt_bearbeiter = b.int_bearbeiter and
    inv_pt_id_sub = :P4_PTIDS
    union select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter where int_behoerde in (SELECT
    CNT_REGIERUNGSBEZIRK FROM TBL_REGIERUNGSBEZIRK where STR_REGIERUNGSBEZIRK = lower (:app_user))Bye,
    Seb

  • Dynamically changing the select list in an LOV based on the login user

    We have a field in a form which is a combobox.The form is to be linked to different profiles of users.Based on the logged in user we would like to restrict the select list in the LOV.ie user1 should see a LOV which is different from that seen by user2.Is this possible.If so how can this be done?Kindly reply.
    Thanks & Regds,
    Jayanthi

    Thanks for ur reply.But my problem is that i have a table having details of some products which includes spareparts also(Name,id,price etc).In my form i have the combobox field which should have a list of these products which the user can select.Now depending on the user's profile he should see only his related products(One profile of users should view only the products but not the spares while the other should view only spares.)The details of both the products and spares are in the same table.we have a criteria to differentiate between the products and the spares.The LOV should display at run time, either products or spares depending on his profile as he logs in. Hope u understood my problem.
    Regds,
    Jayanthi
    Hello Jayanthi,
    I had a similar situation in my last project.
    While you can solve this by modifying your query, this will always come around as may be later some other criteria to restrict based on User/His Role/Something else. Hence I fixed it at design level itself. Though I can't give my situation I can tell you the solution applying my logic.
    Altering your Product Table and adding one more database Column say Product_Category and updating the table with Product Category =1 for Products and 2 for Spares. You can extend this further for other types.
    Create a new Table say User_Groups that will have
    Group_id
    Group_Name
    User_Id columns and will contain all the User ids inserted groupwise.
    Create one last Table Group_Product_Map
    That will have
    Group_id
    Category_id
    This will store each Group_Id followed by Category_id of Products to which these group members will have access to.
    Now write a database function getCategory( p_User) which will query User_Groups table to get Group_Id
    and further query Group_Product_Map Table based on group_id to get Category_Id.
    This function will return category_id.
    Huh!
    So your LOV will have a query as select *(or whatever) from Product where category_id = getCategory(portal30.wwctx_api.get_user)
    Hope this helps
    Madhav

  • Problem writing a sql query for a select list based on a static LOV

    Hi,
    I have the following table...
    VALIDATIONS
    ID          Number     (PK)
    APP_ID          Number     
    REQUESTED     Date          
    APPROVED     Date          
    VALID_TIL     Date
    DEPT_ID          Number     (FK)
    I have a search form with the following field item variables...
    P11_DEPT_ID (select list based on dynamic LOV from depts table)
    P11_VALID (select list based on static Yes/No LOV)
    A report on the columns of the Validations table is shown based on the values in the search form. So far, my sql query for the report is...
    SELECT v.APP_ID,
    v.REQUESTED,
    v.APPROVED,
    v.VALID_TIL,
    d.DEPT
    FROM DEPTS d, VALIDATIONS v
    WHERE d.DEPT_ID = v.DEPT_ID(+)
    AND (d.DEPT_ID = :P11_DEPT_ID OR :P11_DEPT_ID = -1)
    This query works so far. My problem is that I don't know how to do a search based on the P11_VALID item - if 'yes' is selected, then the VALID_TIL date is still valid. If 'no' is selected then the VALID_TIL date has passed.
    Can anyone help me to extend my query to include this situation?
    Thanks.

    Hello !
    Let's have a look at my example:create table test
    id        number
    ,valid_til date
    insert into test values( 1, sysdate-3 );
    insert into test values( 2, sysdate-2 );
    insert into test values( 3, sysdate-1 );
    insert into test values( 4, sysdate );
    insert into test values( 5, sysdate+1 );
    insert into test values( 6, sysdate+2 );
    commit;
    select * from test;
    def til=yes
    select *
      from test
      where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
           =decode('&til','yes',1,-1);
    def til=no
    select *                                                                               
      from test                                                                            
      where decode(sign(trunc(valid_til)-trunc(sysdate)),1,1,0,1,-1)
           =decode('&til','yes',1,-1);  
    drop table test;  It's working fine, I've tested it.
    The above changes to my first idea I did because of time portion of the DATE datatype in Oracle and therefore the wrong result for today.
    For understandings:
    1.) TRUNC removes the time part of DATE
    2.) The difference of to date-values is the number of days between.
    3.) SIGN is the mathematical function and gives -1,0 or +1 according to an negative, zero or positiv argument.
    4.) DECODE is like an IF.
    Inspect your LOV for the returning values. According to my example they shoul be 'yes' and 'no'. If your values are different, you may have to modify the DECODE.
    Good luck,
    Heinz

  • Order in a Select List based in a LOV is wrong

    I have a select list based upon a LOV SQL Query.
    Values in table are:
    FIELD
    001
    002
    003
    AAA
    when I make query in SQL Workshop:
    select FIELD from TABLE order by FIELD;
    I get
    001
    002
    003
    AAA
    But when I make a similar query in LOV the result is in the select list
    AAA
    001
    002
    003
    Someone knows what is happening?
    Thank
    Ander

    mhichwa wrote:
    It looks like your application is running a different sort / NLS preference then is the SQL workshop. Is there a chance your application identifies a language that sorts differently then default APEX. I am just guessing but it could explain this behavior.OK, I think something like this is happening because my Oracle instance have SPANISH like a NLS_LANG parameter, but why is different result between sql Workshop and LOV query, I have installed english and spanish languages in my apex instance, I get the same problem in both cases.
    Other curious think is that my min and max values are OK,
    for example
    BETWEEN: <select list 1> AND <select list 2>
    default value for <select list 1> is
    DECLARE
    exitvalue varchar2(10);
    BEGIN
    select min(FIELD) into exitvalue
    from TABLE
    return (exitvalue);
    END;
    I get 001
    default value for <select list 2> is
    DECLARE
    exitvalue varchar2(10);
    BEGIN
    select max(FIELD) into exitvalue
    from TABLE
    return (exitvalue);
    END;
    I get AAA
    But select list are ordered like
    AAA
    001
    002
    003
    I have based select list in a lot of different sql ways
    select FIELD from TABLE ORDER BY FIELD
    select FIELD from TABLE ORDER BY 1
    select FIELD from TABLE ORDER BY FIELD ASC
    select FIELD from TABLE ORDER BY 1 ASC
    Other extraneous think is that I use DESC order I get
    003
    002
    001
    AAA
    Thanks
    Edited by: user10999912 on 24-Jul-2010 08:07

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

  • Creating a dynamic Selection List based on a View Object

    Hello,
    I'm new to JDeveloper and I would like to create a JSP Page with dynamic Selection List based on a runtime query or based on a view object (BC4J). The selection made by an user should serve another dynamic query with the necessary parameters that I built using createViewObjectFromQueryStmt(). By now I tried this using the InputSelectLOV from the Component Palette in JDeveloper. But without success. By the way: the selection list is not very large (5 values), so it's not necessary to have a form finding the desired value.
    Maybe someone had experience about creating this already. Please give me a tip or a little example.
    Thanks.

    http://otn.oracle.com/products/jdev/howtos/jsp/renderers.html

  • Dynamic Select List based on TextField data

    Hi,
    I like to dynamically display the select list based on the value in the textfield, the data in the textfield is of character type.
    Thanks

    Hello,
    Well as you now know HTML based select lists don't work like that, that widget is called a combo box and there will be built in combo boxes in APEX 3.0, it's a fairly complex dhtml widget.
    What you might want to do is provide a text item next to your select box and an Add New Value Option in your select list.
    Carl

  • Alternate select lists on 2 columns and return more than 1 column

    Hi,
    I try to build 2 alternate select lists and each select list should return more than 1 column
    2 Columns PART_ID and PART_SPECIFICATION
    Now I build a select list on PART_ID like
    select part_id d,part_id r from parts;
    The result should be:
    Column PART_ID has PART_ID and PART_SPECIFICATION must be text of PART_SPECIFICATION
    The other select list based on PART_SPECIFICATION should be like
    select part_specification d,part_id r from parts;
    Now it should be displayed part_specification in PART_SPECIFICATION and part_id in PART_ID.
    This is because one user knows the part_id and another knows only the specification
    Please help me
    Siegwin

    Hi Siegwin,
      Check your application Page 7(copy of page 500)  using select list instead of plugin, it gives all values.
    and works very well,
    use ajax process to get Xml data into page items
    following are changes
    application process: getData
    application item : TEMPORARY_APPLICATION_ITEM
    create one function in page html header pull_multi_value()
    and it call on page item p7_empno on html form element attribute as onchange="pull_multi_value(this.value)";
    this may Helps you,
    Pars.

  • I am working in Numbers and can't seem to change the generic value assigned to the legend.  Any advice on how to select the legend and save new values?

    I am working in Numbers and can't seem to change the generic value assigned to the legend.  Any advice on how to select the legend and save new values?

    Ntenich,
    If your table has a Header and your Legend text is in the header, it will be picked up by the table.
    Jerry

  • 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

  • Copy select value in the textfield from LOV and allow user to edit it

    Hi,
    I have a datablock with 20 records and each record has comments (say field_comments) fields. I would like to allow user to choose predefined comments populated from LOV (say lov_comments) and to append some extra comments after they choose the value from LOV.
    I have created a LOV and added Return type “field_comments” in the column mapping properties. When user clicks on a button, LOV opens up. They select the value from the LOV and the value goes to “field_comment” field. The problem with this approach, user can’t add their comment after selecting from LOV.
    I tried this way too. I created another non-visible textbox (say dummy). In the LOV, I added “dummy” field as returntype. In the dummy field, I have created “POST-CHANGE” trigger which basically says :block. field_comments = :block. Dummy.
    But, the user has to click on other field to view the selected value from the LOV. The values in the “field_comments” is not updated as soon as user click on “OK” button in the LOV.
    I would appreciate it if somebody could give me some input and help to solve my issue. Thank you for your help.
    Thank.

    Well, I tried exactly what you posted and it allowed me to SELECT from LOV and then CHANGE/APPEND new text in front of returned value in the field. It saved to the database and queried without any problems.
    Is your item allowed to INSERT/UPDATE ? If not, then set "Update/Insert Allowed" properties to Yes and attach your LOV to the item and set "Validate from list" to No.
    You may also see if you have any validation being performed on WHEN-VALIDATE-ITEM or POST-CHANGE trigger which will fail since you are editing the values populated from LOV.
    Hope it helps!

  • Select List (Parent/Child) LOV

    I have the Easy Oracle HTML-DB book, they give an example of a
    Parent Child Select List using a query.
    Does anyone know how to apply the Parent/Child relationship with
    a List of Value generated from a table.
    Example
    Parent Child
    Car Pontiac
    Car Buick
    Car Cadillac
    Car Nissan
    Truck Tahoe
    Truck Silverado
    Truck F150
    Truck Titan
    The parent(s) in the above example are Car/Truck, the children are in the adjacent column.
    Objective: When the parent "Car" is chosen, only the "Pontiac/Buick/Cadillac/Nissan" will be available, once the child is selected,
    wish to submit to a empty table that can grow dynamically.
    OS: Windows: XP
    Oracle ver.: 10g
    Apex ver.: Release 2

    Hi,
    are you just having one table storing all the values?
    1) Create a "Select list with Submit"
    2) Lov query would be something like
    SELECT DISTINCT
           CAR_TYPE AS D
         , CAR_TYPE AS R
      FROM WHATEVER_TABLEThe distinct is only because you have mixed your parent and child values in one table instead of having two separate tables with a FK from the child to the parent.
    3) Create another "Select List"
    4) Lov query would be something like
    SELECT CAR AS D
         , CAR AS R
      FROM WHATEVER_TABLE
    WHERE CAR_TYPE = :P2_CAR_TYPE-> in the where clause you restricting the second lov with the value the user has selected in the first select list.
    The first "Select List with Submit" will trigger a full page refresh when you select a car type. If you want to avoid that you can use the AJAX based "Cascading Lov" feature of my ApexLib Framework (see http://apex.oracle.com/pls/otn/f?p=33231:4 ) or search on the forum for "cascading lov ajax" for other similar solutions.
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • Populate a select list based on sql query

    I need to populate a select list using an sql query based on the value value I get from the previous page sent using link . How can I achieve this behaviour ? I tried giving select app_item_id a,app_item_id b from app_item_definition where app_id = :P11_APP_TDL_ID order by 1 in LOV, but it doesn't work . Please advice .

    Okay, I just had the right idea and it's working well! Sorry for posting!
    I return the name of the employee that has edited a dataset and simply add all others of the logged on department! Really easy! Should have thought of that before posting! ;-(
    The correct code is select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter a, vt_tbl_punktdaten b where a.cnt_bearbeiter = b.int_bearbeiter and
    inv_pt_id_sub = :P4_PTIDS
    union select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter where int_behoerde in (SELECT
    CNT_REGIERUNGSBEZIRK FROM TBL_REGIERUNGSBEZIRK where STR_REGIERUNGSBEZIRK = lower (:app_user))Bye,
    Seb

  • Disable Select List based on Button

    I'm a newbie to APEX and I'm trying to disable a Select List only when an onClick action happens in a button(Create New). Otherwise the Select List should be enabled. I know I should be using JavaScript to perform this, but have no clue where to/how to start. Can any of you guide me to any useful threads or perform examples?
    Workspace :SVENKAT
    User ID :[email protected]
    Password :lemope
    I appreciate any help. Thanks!!!
    Shaan

    Shaan:
    You should check out the demo application that is present in your workspace. The application exercises the basic features of APEX and is a good starting point for somebody that wants to learn APEX. For your particular need you should look at page 2 of the demo application. This page uses the 'Report/Form' APEX wizard. As you will see it allows you to 1) List all customers 2) Create a new customer 3) Update an existing customer 4) Delete an existing customer. All these features are implemented using a simple user interface(UI). The UI you have come up with is actually cumbersome and not very intuitive IMO. Take a few moments to get familiar with the demo application. Hopefully it will help you realize the shortcomings of the UI proposed by you. :)
    http://apex.oracle.com/pls/otn/f?p=25444:2
    Login as admin/svenkat
    Varad

Maybe you are looking for