Validation problem for cascading LOV with selectOneChoice for mandatory fields

October 18th, 2010 | Posted by in Oracle ADF | 3 Comments

I have discovered an interesting behavior I want to share with you.

I have implemented cascading LOV using af:selectOneChoice component for mandatory fields and noticed that after selecting a value in the first drop-down list I get validation error for the second one.

Below are the steps to reproduce and  fix the problem :

– made EmployeesEO entity object and changed attributes DepartmentId and ManagerId to mandatory.

– made EmployeesVO view object based on EmployeesEO and defined LOV on DepartmentId attribute. In UI Hints tab I have selected Choice List and checked Include “No Selection” Item:

– defined LOV on ManagerId attribute:

– in UI Hints tab I have selected Choice List and unchecked Include “No Selection” Item:

– added a view criteria in EmployeesVO in order to get the employees of a specific department:

– edited EmployeesVO view accessor and applied EmployeesByDepartmentVC view criteria and set departmentId bind variable value to DepartmentId attribute:

The following problem occurs when we try to add a new employee and we select the value for DepartmentId:


And the manager list is not filtered by selected department.

This problem does not happen if we check Include “No Selection” Item in LOV we defined on ManagerId attribute:

Now the manager list is filtered by selected department.

You can download the sample application CascadingLOV based on default HR schema from here.

Tags: ,

3 Responses to “Validation problem for cascading LOV with selectOneChoice for mandatory fields”

  1. Jiang says:

    Hi, This is a good article, thanks a lot. but I still have a question that:
    although you can filter the manager list by the selected department using the solution above, but when you select the first blank item in DepartmentId dropdownlist, the requried validation error is not popup, This is not what I exepected, do you have any idea to solve this problem.

  2. Ming says:

    Haha, Actually I think it will break the business logic if you tried to add empty value to this required field, so I believe this is kind of bug in Adf, I think the expected result should be like this the Child LOV be disabled when there is no candidate available, and the validation should be disabled as well, and allow user to change to another item from the parent LOV.

  3. Ming says:

    OK, I also composed one simple demo to reproduce this issue, the main problem for this case is you made EmployeesEO entity object and changed attributes DepartmentId and ManagerId to mandatory.

    if you unchecked the mandatory of these two attribute then you are free of this issue.

Leave a Reply