I have a form with a reset button. The purpose of this button is to reset the values of the form. This works fine when there are no validation errors.
When there is validation error, it does not work.
<h:form id="form">
<h:inputText id="v1" value="#{bean.value1}"/>
<h:inputText id="v2" value="#{bean.value2}" required="true"/>
<h:commandLink value="submit" action="#{bean.submit}">
<f:ajax render="v1 v2"/>
</h:commandLink>
<h:commandButton value="reset" action="#{bean.dummy}">
<f:ajax render="@form" resetValues="true"/>
</h:commandButton>
</h:form>
When I try to reset the values before clicking submit button, all values are reset.
When I enter some value at field v1 and no value in field v2, I get validation message as expected when save is pressed.
Now, I try to resetValues by clicking the reset button. It just resets the invalid field v2. The valid field v1 is not reset.
Am I missing any thing.