I have a simple form like the one below with two buttons.
<h:form>
<h:inputText required="#{empty param[save.clientId]}"
value="#{bean.a}" id="a" />
<h:inputText required="#{empty param[save.clientId]}"
value="#{bean.b}" id="b" />
<h:commandButton binding="#{save}" value="WORKING SAVE JSF"
action="#{bean.submit}">
<f:ajax execute="@form" render="@none" />
</h:commandButton>
<h:commandButton value="WORKING SUBMIT JSF" action="#{bean.submit}">
<f:ajax execute="@form" render="@none" />
</h:commandButton>
One button (save) should only pass the values (and exactly the values) to the model without validation. The second one (submit) should validate the input fields and if there is no error, pass to the model.
It does work without <f:ajax
> or with <p:commandButton>
. But simply not with <f:ajax>
How can I achieve this?