Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Select List: Populate Parent and Child (Cascading LOV) based on input in text field

UsrXNov 11 2015 — edited Nov 12 2015

Hi All,

I am new to Apex and trying to get around below scenario:

Page1 contains following text fields and select lists

Text Fields

  • P1_ENAME
  • P1_Job
  • P1_Hiredate

Select Lists

  • P1_DEPTNO
  • P1_MGR

Deptno is a select list based on a SQL (SELECT DISTINCT DEPTNO DISPLAY, DEPTNO RETURN FROM EMP;)

P1_MGR is a select list (cascading list with parent as deptno) with SQL (SELECT DISTINCT MGR DISPLAY, MGR RETURN FROM EMP where DEPTNO = :P1_DEPTNO;)

As per my requirement, both deptno and mgr need to be a select list and independent of the text fields.

When P1_DEPTNO is selected, the P1_MGR list works as intended i.e, lists all P1_MGRs that are part of the P1_DEPTNO

Outcome required:

When P1_ENAME is entered, I wish to see the P1_DEPTNO and P1_MGR populated with value that is assigned to the P1_ENAME in the table.

I have a DA for P1_ENAME as below:

Event: Lose Focus

Selection Type: Items

Item: P1_ENAME

Condition: Is not null

Event Scope: Dynamic

True:

Set value

Set type: SQL (SELECT job,       deptno, mgr,       hiredate    FROM emp where ename = :P1_ENAME;)

Page Items to Submit: P1_ENAME

Affected Elements:

Selection type: Items

Items: P1_JOB, P1_DEPTNO, P1_MGR, P1_HIREDATE

Issue:

The P1_DEPTNO is populated as required (ie the P1_DEPTNO for the P1_ENAME), but the P1_MGR list display value is blank. The P1_MGR list does have valid list entries (ie P1_MGR list that belong to the P1_DEPTNO and P1_ENAME)

Could someone please advise how to get the dynamic action to populate the P1_MGR as well or point me in the right direction to get this to work

Hope I made it clear. Please let me know if you require further information or any clarification

The link to the application I created is : https://apex.oracle.com/pls/apex/f?p=97534

Username:demo

Password:demo

Please use P1_ENAME as KING to test

Below is the database record for KING

EMPNOENAMEJOBMGRHIREDATESALCOMMDEPTNO
7839KINGPRESIDENT756611/17/1981500023410

Thank you for your time

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 10 2015
Added on Nov 11 2015
3 comments
989 views