There seems to be some history with singleSubmit and values reverting to older inputs in this case http://jira.icesoft.org/browse/ICE-8403. However, it was closed as not being reproducible. I've pared down the test to this JSF-only f:ajax powered form and removed icefaces.jar:
<h:form id="frm">
<f:ajax event="blur">
<h:panelGrid columns="3">
<h:outputLabel for="name" value="Name:"/>
<h:inputText id="name" value="#{personBean.name}" required="true" maxlength="50"/>
<h:message id="nameMsg" for="name"/>
<h:outputLabel for="age" value="Age:"/>
<h:inputText id="age" value="#{personBean.age}" required="true"
size="2" maxlength="2">
<f:validateLongRange minimum="1" maximum="99"/>
</h:inputText>
<h:message id="ageMsg" for="age"/>
</h:panelGrid>
<h:commandButton id="submitId" value="Submit" actionListener="#{personBean.submitButton}"/>
</f:ajax>
</h:form>
And compared the behaviour to an ICEfaces-powered singleSubmit form:
<h:form id="frm">
<icecore:singleSubmit/>
<h:panelGrid columns="3">
<h:outputLabel for="name" value="Name:"/>
<h:inputText id="name" value="#{personBean.name}" required="true" maxlength="50"/>
<h:message id="nameMsg" for="name"/>
<h:outputLabel for="age" value="Age:"/>
<h:inputText id="age" value="#{personBean.age}" required="true"
size="2" maxlength="2">
<f:validateLongRange minimum="1" maximum="99"/>
</h:inputText>
<h:message id="ageMsg" for="age"/>
</h:panelGrid>
<h:commandButton id="submitId" value="Submit" actionListener="#{personBean.submitButton}"/>
</h:form>
So far the behaviour between the two is not entirely consistent:
The ICEfaces version with the singleSubmit form shows the behaviour we are concerned about where it puts back in the old value when I clear out a field and trigger validation. The JSF-only version doesn't have the problem. It submits on blur but it's not triggering the validation when blurring; only when clicking the Submit button.
My guess is that when the field is cleared, the validation failure prevents the cleared field value from being set resulting in the next response returning the field to it's previous value. In other words:
- First, frm.name=Deryk is submitted
- then, frm.age=29 is submitted
- then, frm.age=0 is submitted but detected as invalid so 0 is not set
- then, frm.name=Elvis is submitted and the resulting response sets frm.age to 29
I presume that this problem is relatively unique to ICEfaces + singleSubmit + validation.
The submittedValue is getting lost by the drop-down execute?
– Mark