Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-11978

Graph Validator - does not mark context to fail validation

    Details

      Description

      GraphValidator is using BeanValidator to check that instance does not failed [1],
      and it calls facesContext.renderResponse() when beanValidation returns some message.

      However it does not call facesContext.validationFailed().

      [1] https://github.com/richfaces/components/blob/develop/validator/ui/src/main/java/org/richfaces/component/AbstractGraphValidator.java#L213


      This causes problem when another component reads the FacesContext.isValidationFailed() flag in order to distinguish is it should proceed or not, like in following snippet.


      Following snippet is part of the wizard using togglePanel and toggleControl in order to switch panels.

      When user hits Continue button, togglePanel is switched regardless the graphValidator validation failed or not - when validation for another component like h:inputText fails, toggleControl does not switch.

      ...
      <rich:togglePanelItem>
          <!-- Step 3: password -->
       
          <rich:graphValidator id="passwordsValidation" value="#{passwordBean}">
              
              <rich:messages for="passwordsValidation" />
              
              <h:panelGrid columns="3">
                  <h:outputLabel for="password" value="Password" />
                  <h:inputSecret id="password" value="#{passwordBean.password}" />
                  <rich:message for="password" />
       
                  <h:outputLabel for="passwordConfirmation" value="Confirmation" />
                  <h:inputSecret id="passwordConfirmation" value="#{passwordBean.passwordConfirmation}" />
                  <rich:message for="passwordConfirmation" />
              </h:panelGrid>
       
              
              
              <a4j:commandButton value="Back">
                  <rich:toggleControl event="click" targetItem="@prev" />
              </a4j:commandButton>
       
              <a4j:commandButton value="Continue">
                  <rich:toggleControl event="click" targetItem="@next" />
              </a4j:commandButton>
          </rich:graphValidator>
      </rich:togglePanelItem>
      ...
      

        Gliffy Diagrams

          Activity

          lfryc Lukáš Fryč created issue -
          lfryc Lukáš Fryč made changes -
          Field Original Value New Value
          Status Open [ 1 ] Pull Request Sent [ 10011 ]
          Git Pull Request https://github.com/richfaces/components/pull/22
          bleathem Brian Leathem made changes -
          Fix Version/s 4.2.1.Final [ 12319019 ]
          Priority Major [ 3 ] Minor [ 4 ]
          Git Pull Request https://github.com/richfaces/components/pull/22 https://github.com/richfaces/components/pull/22
          bleathem Brian Leathem made changes -
          Git Pull Request https://github.com/richfaces/components/pull/22 https://github.com/richfaces/components/pull/22
          Component/s component-validators [ 12313230 ]
          lfryc Lukáš Fryč made changes -
          Assignee Lukáš Fryč [ lfryc ]
          lfryc Lukáš Fryč made changes -
          Status Pull Request Sent [ 10011 ] Resolved [ 5 ]
          Resolution Done [ 1 ]
          velias Vlastimil Eliáš made changes -
          Workflow GIT Pull Request workflow [ 12483216 ] GIT Pull Request workflow with automatic PR triggers [ 12645729 ]

            People

            • Assignee:
              lfryc Lukáš Fryč
              Reporter:
              lfryc Lukáš Fryč
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development