Showing posts with label Dependent List. Show all posts
Showing posts with label Dependent List. Show all posts

Wednesday, March 17, 2010

Creating dependent list of values using JDeveloper 11g

In this post I will discuses how to build a dependent list of value, in which two lists are involved.
This example is built on scott Emp/Dept tables in which it gets the list of employees working in specific department using single selection list.

So, after creating the required application using JDeveloper 11g, I created an ADF business components from tables attached to scott schema. When using the wizard it should create EMP and DEPT entities, views and a view link describing the constraints the exists between the dept_id in EMP table and dept_id in DEPT table.

The model should look somthing like the following figure, the view FKDeptnolink construct the relation between the two tables. Modify the DeptView and set OrderBy clause to order values by Dept_no, this will help to get Dept_no filed that correspond to Dept_name filed from the iterator that will be defined later in next steps.


then, create a view page in the view controller, this page will contain our list of values.
From data control drag the DeptView1 component and drop it on the page, select ADF Select One Choice component.


In the Edit List Binding, the Display Attribute select Department Name, and click ok.