Thursday, February 11, 2010

New Cascading LOV with required View Criterion Not a Bug

On july 2009 in the patch of jdeveloper ( a new feature was introduced in view criteria. When a criterion is required then an error message is shown to user. Of course not without side-effects (
On the latest patch of jdeveloper ( a new feature and bugs was introduced in view criteria (
The above bugs also effected the functionality of LOVs especially of those that use view criteria, either for selective required ( or for cascading LOVs.

In the current test case I have Employees and I want the List of value of Managers to depend on the department of the employee. I expect when the user has not selected a department the List of values of managers to be empty

Yet when I run application, just when I set department to null I get the following error.

ADF: Adding the following JSF error message: Attribute DepartmentId is required.
oracle.jbo.AttrValException: JBO-27035: Attribute DepartmentId is required.
at oracle.jbo.rules.JboVCItemRequiredValidator.validateItem(
at oracle.jbo.rules.JboVCItemRequiredValidator.validate(
at oracle.jbo.common.ViewCriteriaImpl.validateRow(
at oracle.jbo.common.ViewCriteriaImpl.validate(
at oracle.jbo.server.ViewRowSetImpl.validateViewCriteria(
User will think that DepartmentId is required, yet only the hidden criterion of LOV is required.

But actually it is just a warning, since if I press ok and submit then the new values are submitted, even though the value of ManagerId is not valid.

If I open ManagerLOV I get again the error and the LOV opens with no data.

If I clear the value of Manager I get the error again.

This is realy confusing and makes view criteria not usable in cascading LOVs.

The workaround we do for these cases is not to use view criteria for cascading LOVs but to put conditions directly in the where clause of the query.

Test Case

Anonymous said... In this case, all you need is to set "Validation" to "Optional" and leave "Ignore Null Values" un-checked.

I tried it and works fine.


  1. I think its just a wrongly-defined use case:

    If you need the DepartmentId required, do not give the option of "Include "No Selection" Item" in the LOV_DepartmentId. Otherwise, set "Validation" to "Optional" and "Ignore Null Values" checked in the ManagersLOVCriteria.

  2. The use case is this

    Department and manager of Employee should be optional,
    Manager of the Employee must be of the same department.
    So when Employee has no department then Managers LOV should be empty.

    I think its a common use case.

  3. In this case, all you need is to set "Validation" to "Optional" and leave "Ignore Null Values" un-checked.

  4. You are right. Thanks for your contribution, i will update this as Not a bug.

  5. Yes correct , i did the same and it did not created a issue for me.

    I selected made deptname , dept id as 'selectively required' and managed_id as optional with ignore null value unchecked.first time managed id drop down will be blank.

    if i dont give any value it gives exception 'one of field is required' ,then i select dept_id , managed_id dropdown will dynamically change based on dependent LOV setting.

    Question: I want to overide the af:query message 'atleast one field required' to something else.