Details
Description
In the page generated by the following code I click Save button for blank form and receive validation errors about reqiored field.
Having this messages on screen I'm trying to click Search link and validation errors are still present, when it is expected that required validation should be disabled for inputText.
--- CODE
<ice:form>
......
<h:panelGroup styleClass="required">
<h:inputText id="designCustomerSearch" value="#{searchMaps.CustomerList.hname}"/>
</h:panelGroup>
<ice:commandLink partialSubmit="true"
action="selectCustomer"
value="#{ui.cmn_search}">
<f:setPropertyActionListener value="true" target="#{helper.customersShowTable}" />
<f:setPropertyActionListener value="true" target="#{helper.selectCustomer}" />
<f:setPropertyActionListener value="#{dr.selectedItem.parent.bo.distiId}" target="#{searchMaps.CustomerList.distiId}" />
</ice:commandLink>
......
<h:inputText id="qty" value="#{searchMaps.gty}" reguired="true"/>
....
<ice:commandButton value="#{ui.cmn_save}" action="..." />
</ice:form>
--- /CODE
Having this messages on screen I'm trying to click Search link and validation errors are still present, when it is expected that required validation should be disabled for inputText.
--- CODE
<ice:form>
......
<h:panelGroup styleClass="required">
<h:inputText id="designCustomerSearch" value="#{searchMaps.CustomerList.hname}"/>
</h:panelGroup>
<ice:commandLink partialSubmit="true"
action="selectCustomer"
value="#{ui.cmn_search}">
<f:setPropertyActionListener value="true" target="#{helper.customersShowTable}" />
<f:setPropertyActionListener value="true" target="#{helper.selectCustomer}" />
<f:setPropertyActionListener value="#{dr.selectedItem.parent.bo.distiId}" target="#{searchMaps.CustomerList.distiId}" />
</ice:commandLink>
......
<h:inputText id="qty" value="#{searchMaps.gty}" reguired="true"/>
....
<ice:commandButton value="#{ui.cmn_save}" action="..." />
</ice:form>
--- /CODE
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
The JSF specification states that a form that contains any component with an invalid state cannot be submitted, nor any model values updated . Previously, we were not adhering to the spec, although the current behaviour is expected. The model value of an invalid component should not be updated, and the lifecycle should be short-circuited when conversion or validation does not succeed. If an application needs to access the input of an invalid component, the application can use other mechanisms, such as binding the component, and accessing the 'submittedValue' instead of the model value. If the application needs to call an action or actionListener inside a form that contains an invalid component, then the 'immediate' attribute should be used to have the action or actionListener fire in the "apply request values" phase, before the conversion and validations phase.