Problem in immediate aid = true to display a dynamic page

I have a page that renders a field (B) as required under certain conditions according to the value of a list of mandatory selection (list A). I need field B to render it again when the list changes. I have list A autoSubmit = "true" with the partialTriggers attribute value on the domain container B value the id of the list. However, if the field has a figure to the value which requires the mandatory B field, but field b has not been set yet and list is replaced by the value that makes the field B non-mandatory, the B field validation runs and prevent the submitted form. To work around this problem, I put immediate = "true" to the list and have a valueChangeListener that defines the value sent to the list and calls FacesContext.getCurrentInstance () .renderResponse (), in order to avoid any subsequent validation. It all works very well.

The problem is that the page contains a button cancel with immediate = "true". If the user creates a new record and no value has been selected yet for the a list, but they hit the Cancel button, mandatory validation runs list, fails, and does not have the form (cancel does not run). The user is required to enter a value to exit the page.

Is it possible to have a required field with immediate = "true" in order to get the PPR I need, but who have still a Cancel button which will work without run validation on the other immediate field?

Problem solved. Documentation tag subform:

"The content of a subform will be validated (or another treatment) If a component inside the subform is responsible for submitting the page or if the default attribute is set to true.

Default = "true" give me the validation that I need as well as the behavior of partial page rendering I want

Tags: Java

Similar Questions

Maybe you are looking for