Defining Cascading List of Values in ADF

Tweet about this on TwitterShare on Facebook0Share on LinkedIn8Share on Google+0

When you have a field, and its value depends on the selection in another field, you may create a Cascading List of Values (LOV). A city field that depend on the selection in country field, is a good example of Cascading LOV. In this post, you will see how simple is, define a Cascading List of Values using ADF 12c.

Download the sample application: ADFCascadingLOVApp.zip.

First of all, we need to create a View Criteria to filter employees by department.
In the Applications window, open the EmployeesView file, and click the View Criteria navigation tab.
In the View Criteria page, click the green plus-sign icon to create the View Criteria.
In the Create View Criteria dialog, change the Criteria Name to EmployeesByDepartmentViewCriteria, click Add Item button and define as “DepartmentId = :CurrentDept”, and click OK.

defining-cascading-list-values-adf1

Now, let’s configure the list of values for the ManagerId attribute.
Click the Attributes navigation tab and select the ManagerId attribute.
Click the List of Values tab, and then click the green plus-sign icon to create a list of values.
In the Create List of Values dialog, click the green plus-sign icon in the List Data Source section and choose the EmployeesView View Object. In the List Attribute section, choose the EmployeeId attribute.

defining-cascading-list-values-adf2

Click the UI Hints tab, select FirstName and LastName attributes and click OK.

defining-cascading-list-values-adf3

Click the Accessors navigation tab, select the EmployeesView1 View Accessor and click the pencil icon.
In the Edit View Accessor dialog, select the EmployeesByDepartmentViewCriteria, set the value of CurrentDept to DepartmentId and click OK.

defining-cascading-list-values-adf4

Don’t forget to configure the List of Values to DepartmentId.

defining-cascading-list-values-adf5

Done!
Run the AppModule and test the Cascading LOV.

defining-cascading-list-values-adf6

defining-cascading-list-values-adf7

Run the Application and test the Cascading LOV.

defining-cascading-list-values-adf8

defining-cascading-list-values-adf9

Tweet about this on TwitterShare on Facebook0Share on LinkedIn8Share on Google+0

Author: Waslley Souza

Consultor Oracle com foco em tecnologias Oracle Fusion Middleware e SOA. Certificado Oracle WebCenter Portal, Oracle ADF e Java.

Leave a Reply

Your email address will not be published. Required fields are marked *