Conditionally required jsf validation in a4j form
- by volothamp
Hello, I'm having a little problem with using conditionally evaluated expression in jsf/a4j
Here's my code
<a4j:form>
<h:inputText id="id1" value="#{mybean.myvalue}" size="1"
required="#{not mybean.condition}"
rendered="#{not mybean.condition}"
requiredMessage="Put a number in here" />
<h:selectBooleanCheckbox value="#{mybean.condition}">
<a4j:support event="onclick" reRender="id1"/>
</h:selectBooleanCheckbox>
<a4j:commandButton action="#{mybean.myaction}" value="Do something" />
</a4j:form>
The boolean checkbox conditionally enable/disable the validation.
This doesn't work: the a4j:commandButton simply skip the validation.
Thanks.