This content has been marked as final.
Show 3 replies
-
1. Re: Order of validations
hasan_muhstaq Jun 13, 2008 11:48 AM (in response to stephen)You can launch the validation directly on an onblur event. this would show u the error before u submit
<h:inputText value="#{myValue}" required="true"> <a:support event="onblur" reRender="myField, msgZone"/> </h:inputText>
For showing a meaning error, customize it urself
@NotNull @Length(min=1) @ZipCode(message="#{messages['location.value.invalid']}") public String getValue() { return value; } public void setValue(String val) { value = val; }
Hope this helps
-
2. Re: Order of validations
stephen Jun 13, 2008 12:46 PM (in response to stephen)You misunderstood the question.
Even if doing validation using ajax, the validator message will becannot be empty
.
I would like the hibernate model validator be checked before, so that the user gets the more meaningful messagemust be between 4 and 12 characters
. -
3. Re: Order of validations
gjeudy Jun 13, 2008 3:30 PM (in response to stephen)I think you cannot achieve that with JSF. If you don't specify
required=true
and the user enters no values your custom validation will not even kick-in because JSF doesn't take this as a field update.
In the execution ordering
required=true (JSF feature)
will always kick-in before your custom validation.
If somebody has found a workaround for this I'd be grateful to hear. I'm stuck with the same problem and I believe this is a JSF limitation.
Regards,
-Guillaume