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.