immediate="true" for the current input component does not stop the validators of other input components from triggering. This only leads to the fact that the current input component will be checked one phase earlier than usual. Basically, you need to attach a valueChangeListener to the input component and then call FacesContext#renderResponse() in the listener method so that processing of all other input components is skipped.
But since you already use JSF 2.0, it is much better / easier to use ajax powers instead of this old-fashioned JSF 1.x approach.
eg.
<h:selectOneMenu value="#{bean.country}"> <f:selectItems value="#{bean.countries}" var="country" itemLabel="#{country.name}" itemValue="#{country.code}"/> <f:ajax listener="#{bean.changeCountry}" /> </h:selectOneMenu>
from
public void changeCountry() { System.out.println("Selected country is: " + country); }
If you want to re-render some parts of the form each time the selection is changed, use the render attribute. For example.
<f:ajax listener="#{bean.changeCountry}" render="otherComponentId" />
See also:
Balusc
source share