Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4550

f:validateWholeBean must be placed after all validated fields

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.15, 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC3
    • 4.0.0-RC5
    • None
    • None

    Description

      https://jakarta.ee/specifications/faces/4.0/vdldoc/f/validatewholebean says:

       

      This tag must be placed in the component tree after all of the fields that are to be included in the multi-field validation. If this precondition is not met, the results of applying this tag are unspecified.

      I've tested a scenario as so:

          <h:outputText value="Password" />  
          <h:inputSecret id="password1" value='#{backingBean.password1}'>
              <f:validateBean validationGroups="PasswordValidationGroup" />
          </h:inputSecret>
      
          <f:validateWholeBean value='#{backingBean}' 
              validationGroups="PasswordValidationGroup" />
      
          <h:outputText value="Password again" /> 
          <h:inputSecret id="password2" value='#{backingBean.password2}'>
              <f:validateBean validationGroups="PasswordValidationGroup" />
          </h:inputSecret> 

      and found that the values following f:validateWholeBean are not available caused the validation to fail.

      Mojarra throws an exception if the placement is incorrect and as should we.

      It's also part of the TCK: https://github.com/jakartaee/faces/blob/4.0.1/tck/faces22/multiFieldValidation/src/test/java/ee/jakarta/tck/faces/test/javaee7/multiFieldValidation/Spec1IT.java#L206

       

       

      Attachments

        Issue Links

          Activity

            People

              volosied Volodymyr Siedlecki
              volosied Volodymyr Siedlecki
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: