0
votes

Let's say I have 2 Select List items on page. Both lists should be static. I am able to set first list items statically:

STATIC2:Lab1;1,Lab2;2,Lab3;3

Now based on this selection, I want second list to show one of the value sets:

for 1 in first list => STATIC2:One;1,Two;2,Three;3
for 2 in first list => STATIC2:Apple;1,Pear;2,Orange;3
for 3 in first list => STATIC2:None;-1

Basically no query from tables is required. How can I achieve this? What parameters my items should have and/or script?

1

1 Answers

1
votes

As for me, I think easiest way here is to create table/query for second static list. Something like this:

with LOV2 as (select 1  return_value, 'One' display_name, 1 lov1_id from dual union all
              select 2, 'Two',   1 lov1_id from dual union all
              select 3, 'Three', 1 lov1_id from dual union all
              select 1, 'Apple', 2 lov1_id from dual union all
              select 2, 'Pear',  2 lov1_id from dual union all
              select 3, 'Orange',2 lov1_id from dual union all
              select 1, 'Almost none', 3 lov1_id from dual union all
              select 2, 'None',   3 lov1_id from dual)
select display_name, return_value
  from LOV2
 where lov1_id = :P_LOV1_VALUE

And use this query as source of LOV2.

UPD

Go to Shared Components -> User Interface -> Lists of Values. Click Create, then From scratch. Then you can see a field Type, where you can select static or dynamic type. Static list is a list where you directly values to display and return values. Dynamic list is a result of SQL query. Every list have two fields: display_value - a value which user see on the screen and return value - a value which you will get in your PL/SQL code. Also LOV can be named - it is a LOV, created in Shared Components section (you can use it on many pages, and when you change it, it will changed everywhere). To use named LOV on a page open item's properties, in section LIST of Values choose name of required LOV in field Named LOV.
My query above is a source for dynamic LOV, you can create a named LOV with it or use in LOV definition on a page.