Validation Problem with Cascading mandatory fields in ADF Faces

Sharing is Caring

It is a functional requirement, suppose in application one fields is dependent on another field for its value or any property (required, disable, visible), it means when you select the first field and put value in that then second field’s value or other property is populated.
or the second one is, you have multiple mandatory fields (cascading) in the page and any of that’s AutoSubmit  is set to true, in this case when user puts value in the first field and goes to second to enter value but before this a large message window appears with required validation and all fields get red.

mandatory fields

This is very much annoying for the user to face this kind of message each time, as I had a scenario where there were 15 required fields in af:form on popup and 10 of that are set to AutoSubmit true.
to avoid this see steps

  • Suppose I have a page with create button for Departments table (default HR Schema) on pop up as a form and all fields are required
  •  When the user clicks on create button and put value in the field of DepartmentId, all required fields throw an exception

 

  • To avoid this I have set immediate true for first required field that is DepartmentName, it means when any validation occurs on the popup, DepartmentName field will skip all validation on the page and will show only of its own
  •  Now when the user put value in DepartmentId field, only DepartmentName field shows exception (required)

Cheers 🙂 Happy Learning

Related Posts

0 thoughts on “Validation Problem with Cascading mandatory fields in ADF Faces”

  1. Hi Ashish,

    Is their any better solution. In 12c dialog cancel is depreciated. if I am using buttons to perform save and cancel. on Cancel button immediate property filed is asking as a required.

    Thanks,

  2. Hi Ashish,

    Thanks for your postings i have a same scenario but with different component in my case am working with af:calendar when user press single click on calendar empty place it was(activityDetail) loading popup perfectly. But when if it's a double click it was throwing validation errors as a list how to prevent that list and i tried immediate=true but it was not solved my issue…

    is there any alternative to handle that dblClick event in af:calendar activityDetail facet.

    Thamks?

    Praveen M90.

Leave a Reply

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