RichFaces
  1. RichFaces
  2. RF-11978

Graph Validator - does not mark context to fail validation

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved (View Workflow)
    • Priority: Minor Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.2.1.CR1
    • Component/s: component-validators
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      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>
      ...
      

        Activity

        Hide
        Lukáš Fryč
        added a comment -

        Blocks writing AS7 QuickStart #28.

        Show
        Lukáš Fryč
        added a comment - Blocks writing AS7 QuickStart #28 .

          People

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

            Dates

            • Created:
              Updated:
              Resolved: