[ 
https://issues.apache.org/jira/browse/MYFACES-2528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830894#action_12830894
 ] 

Jakob Korherr commented on MYFACES-2528:
----------------------------------------

Hi Michael,

There are some problems with the validator attributes and ValueExpressions. Not 
only the validationGroups, but also the disabled attribute. The problem here 
(on my opinion) is the spec. The way the spec describes these attributes does 
not (really) allow changing the value of them via a ValueExpression.

For example the disabled attribute: If this is set to true the validator is not 
added to the component and its validatorId is added to an exclusion list. So 
there is no connection to the real validator (or the handler) anymore and a 
change of the attribute value is just not recognized correctly. The same 
applies for the validationGroups.

Maybe you could get in touch with Ed or someone from the EG to get some answers 
if this is expected or (and that is what i think) just not thought of.

Thanks!

> BeanValidator validation groups are overwritten with PSS
> --------------------------------------------------------
>
>                 Key: MYFACES-2528
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2528
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta
>            Reporter: Michael Kurz
>         Attachments: MYFACES-2528.patch
>
>
> Setting the validation groups of a bean validator like <f:validateBean 
> validationGroups="#{bean.groups}"/> is not always working correctly with PSS. 
> Property bean.groups returns null or the class name of a validation group in 
> my example based on the value of a boolean checkbox:
> <h:selectBooleanCheckbox value="#{bean.prop1}"
>     valueChangeListener="#{bean.prop1Changed}"
>     immediate="true" onclick="this.form.submit()"/>
> <h:inputText value="#{bean.prop2}" rendered="#{bean.prop1}">
>   <f:validateBean validationGroups="#{bean.groups}"/>
> </h:inputText>
> If I check the boolean checkbox the form is submitted and rendered again with 
> the additional input field. The problem now is that the validation groups are 
> set correctly on building the view during the second traversal of the 
> lifecycle before restoring the state. But on restoring the validator this 
> value is overwritten with the old value from the state and my validation 
> group is gone again.
> As the BeanValidator is a PartialStateHolder this can be avoided by only 
> saving and restoring the state if the initial state was not marked.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to