ICEfaces
  1. ICEfaces
  2. ICE-2666

PartialSubmit doesn't disable required for other components if page is in invalid state

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 1.7DR#3
    • Fix Version/s: 1.7
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Any
    • Assignee Priority:
      P2
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      I modified setRequiredFalseOnAllChildrenExceptOne method in com.icesoft.faces.webapp.http.core.ReceiveSendUpdates and removed "&& input.isValid()" in "if" on line 126. Everything is working, but I'm not sure that I did the right thing :)
      Show
      I modified setRequiredFalseOnAllChildrenExceptOne method in com.icesoft.faces.webapp.http.core.ReceiveSendUpdates and removed "&& input.isValid()" in "if" on line 126. Everything is working, but I'm not sure that I did the right thing :)

      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

        Activity

        Hide
        Philip Breau added a comment -

        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.

        Show
        Philip Breau added a comment - 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.

          People

          • Assignee:
            Philip Breau
            Reporter:
            Dmitry Kudryavtsev
          • Votes:
            8 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: