Search code examples
jsfjsf-2

JSF immediate=true to Skip Validation


Shouldn't the immediate="true" of the commandLink skip validation? I'm still getting the "password is Required" message when I click that link, any ideas?

<h:inputSecret id="j_password" autocomplete="off" value="#{authenticationBean.password}" required="true" requiredMessage="Password is Required" />

<p:commandLink action="#{authentication.forgotPassword}" ajax="false">
    <h:outputText value="#{bundle['login.forgotpassword.TEXT']}" immediate="true"/>
</p:commandLink>

Solution

  • You've put it on the <h:outputText> instead of the <p:commandLink>. The immediate attribute has no effect on UIOutput components (and would yield a XML validation error on some environments as well), it has effect on UIInput and UICommand components only. Move the attribute to the <p:commandLink> component.