previous | index | next

Unwanted Validation

Suppose the registration form with the country listener is changed to add a required validator to the address field.

Now there is an unwanted validation error message when the user simply selects a different country from the list.

Recall that the select menu does a submit when there is a menu change:

     <h:selectOneMenu value="#{form.country}" onchange="submit()"
        valueChangeListener="#{form.countryChanged}">
        <f:selectItems value="#{form.countryNames}"/>
     </h:selectOneMenu>

Then the Process Validations phase of the JSF life cycle catches the validation error.

Note that the first process events phase has an option to bypass validation and go directly to the Render Response phase.

This is accomplished by:


previous | index | next