You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2012/05/16 07:30:14 UTC

[jira] [Commented] (MYFACES-3547) Can't use expression for validator attributes

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

Leonardo Uribe commented on MYFACES-3547:
-----------------------------------------

It is a known weakness in jsf standard converters and validator. To overcome this limitation, some converters and validators were created in MyFaces Commons project that evaluates its parameters when the value is checked, There is no variant for f:validateLongRange, but there is a mcc:convertNumber and mcc:convertDateTime.

Unfortunately, by compatibility with the spec it is not possible to change the current behavior. A change should be done at spec level. It is possible to write a custom implementation of that validator using myfaces builder plugin.
                
> Can't use expression for validator attributes
> ---------------------------------------------
>
>                 Key: MYFACES-3547
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3547
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.1.7
>         Environment: validator ajax
>            Reporter: Deryk Sinotte
>            Priority: Minor
>         Attachments: validator.zip
>
>
> Attaching a test case that shows a problem when using an expression for an attribute in a validator. We have markup that looks like this:
> <h:inputText id="ajaxMy"
> value="#{testBean.myNumber}">
> <f:validateLongRange minimum="1"
> maximum="#{testBean.maxValue}"/>
> <f:ajax execute="@this"
> render="@form"/>
> </h:inputText>
> When the value of the maximum attribute is modified via Ajax from another input field, the value of the bean is properly set but the validator doesn't resolve appear to resolve the expression at the right time and the result is that validation occurs against the "old" values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira