Search code examples
oracle-databaseplsqloracle-apexoracle-apex-5

Cascading LOVS - default values


I have two cascading LOVs. After changing value of my first LOV in second LOV appropriate values are populated.

enter image description here

First LOV: name - P2_DEPTNO

select dname, deptno  
from dept  
order by 1;  

Second LOV: name - P2_EMPNO

select ename, empno  
from emp  
where deptno = :P2_DEPTNO;  

cascading LOV parent - P2_DEPTNO

What should I add to set default value of second LOV (first row from query) after changing first LOV value?


Solution

  • Finally, I got the correct answer on the Oracle community forum.

    This is possible in only one case, because I'm more familiar with this type of issue in my project. We need to change the second item type i,e "Empno" item type from Pop-up LOV to Select-List. Also make null setting changes as per given below :

    enter image description here

    On DEMO works proper.

    enter image description here

    Please note that this will CAN NOT be achieved with item type as POP-UP LOV directly using simple step. To make this work using you need to work on POP-UP LOV we need so much custom changes, like DYnamic Actions , JS Code, Asynchronous calls to DB.

    Source - https://community.oracle.com/thread/4048009
    Author - EnigmaCoder