[ 
https://issues.apache.org/jira/browse/MYFACES-4550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Andraschko resolved MYFACES-4550.
----------------------------------------
    Resolution: Fixed

> f:validateWholeBean must be placed after all validated fields
> -------------------------------------------------------------
>
>                 Key: MYFACES-4550
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4550
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.2.15, 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC3
>            Reporter: Volodymyr Siedlecki
>            Assignee: Volodymyr Siedlecki
>            Priority: Major
>             Fix For: 4.0.0-RC5
>
>
> [https://jakarta.ee/specifications/faces/4.0/vdldoc/f/validatewholebean] 
> says: 
>  
> {noformat}
> 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.{noformat}
> I've tested a scenario as so:
> {code:java}
>     <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> {code}
> 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]
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to