FROM THE BLOG

ADF Tutorial: How to implement dependent list of values

When working with ADF Business Component, a common requirement is to implement a dependent list of values based on the current row of a View Object. For example, you are implementing a simple application that will update / change the manager of a department within your organization. As business requirement, the future manager can only be an employee that belongs to the department itself so your list of value should show only employees for that department.

First of all, we need to create a list of values for our ManagerId field;

adf_bc_list_of_values

We add our ViewAccessor to bring the employees.

adf_bc_list_of_values_new_accessor

Now we select the attributes and what we want to show in the UI

adf_bc_list_of_values_select_attributes

adf_bc_list_of_values_UI_Hints

Now, if we run our application module to test

am_adf_bc_list_of_values

We can see that we are listing all the employees, even though the department just have one employee assigned to it. This is because we are not filtering our view accessor by departments. To do this, we need to create a view criteria in the Employees View Object and use it in our view accessor.

adf_bc_new_view_criteria

adf_bc_list_of_values_new_accessor_view_criteria

am_adf_bc_list_of_values_with_vc

am_adf_bc_list_of_values_with_vc_2

One comment

  1. Oscar

    on

    Reply

    Muy interesante el tutorial, disculpe podrían pasar el proyecto completo. Se los agradecería. Saludos.

Leave a comment

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

Social Media

Stay up-to-date with our latest ADF and related technical posts via your favourite social network services.