myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <>
Subject [jira] [Commented] (MYFACES-3892) Create a option to execute BeanValidation before JSF-Validation
Date Fri, 16 May 2014 11:25:02 GMT


Leonardo Uribe commented on MYFACES-3892:

In JSF, there is a BeanValidator class that extends from JSF Validator interface. JSF doesn't
make any distinction, so I don't think we can do something in this case, specially because
EditableValueHolder interface doesn't provide methods to manipulate the ordering how the validators
are added. The code that usually adds BeanValidator is on ComponentTagHandlerDelegate, so
that's the reason why that validator is the last to be executed, because it is the last to
be added, but that's not always the case. You can control the order how the validation is
performed just using f:validateBean in your component:

<h:inputText ... >
    <f:validateBean ...>
     .... other validators ....

> Create a option to execute BeanValidation before JSF-Validation
> ---------------------------------------------------------------
>                 Key: MYFACES-3892
>                 URL:
>             Project: MyFaces Core
>          Issue Type: Improvement
>    Affects Versions: 2.2.3
>            Reporter: Rene O
> As stated in this answer: BeanValidation is executed
after JSF-Validation.
> But it would be very useful to have a way to change this behaviour.
> Now you can't decide within jsf-validator wether a component is valid or not in terms
of BeanValidation
> {code}
> //My JSF-Validator
> //...
> UIInput input = (UIInput) component;
> if (!input.isValid()) {
>     return;
> }
> // own jsf-validation rules...
> //...
> {code}

This message was sent by Atlassian JIRA

View raw message