Let's Suppose we have the first list DNAME
which displays all the department names stored in the department table.
The idea of populating
the second popup list depending on the selected value of the first popup list
is replies in using a specific DEPTNO value to filter the values displayed
according to the Second popup list
example is intended to populate the
emp_name in respect to the first list-item selection of e.g. DNAME
When-List-Changed Trigger of the First
List e.g." DNAME" you have to
-- The following code attain the key solution of the problem.
-- The list DNAME will be changed depending on the DNAME list value
-- selection & filtered by the DEPTNO
rg_name VARCHAR2(40) := 'EMP';
list_id Item := Find_Item('EMP.ENAME');
-- The following is checking your Group doesn't already exist through
-- searching for it and delete it if exists.
rg_city := FIND_GROUP(rg_name);
IF NOT id_null(rg_city)
-- If it doesn't exist then create it and add your query to it
rg_city :=CREATE_GROUP_FROM_QUERY(rg_name , 'SELECT ENAME , ENAME FROM EMP WHERE
WHEN OTHERS THEN MESSAGE('Follow up the error : '||SQLERRM);
Note: in the select statement there are two
database columns selected; 'SELECT ENAME , ENAME' one column for the 'List Element' and the other column is for 'List
Item Value'. In compare with 'The Static List Item' that has a fixed value; "Elements
In List" property.