Hi,
I use the stack JSF 2 (RI 2.0.2) + ExtVal (2.0.4-SNAPSHOT) . With @Equals I
do a simple email check.
What I wanted to do is ajax validation and the equality is only checked if
the user leaves the secound input field?
Here are bean and facelet snipp:
################# bean snip
public class EmailBean {
@Email //hibernate constrain
@UniqueEmail //custom jr 303 annotation
@NotEmpty //hibernate constrain
private String email;
@Equals
private String emailRepeat;
################# facelet snipp
<h:panelGroup id="emailBlock" layout="block">
<h:message id="emailInputMsg" for="emailInput"/>
<h:outputLabel value="Email" />
<h:inputText id="emailInput" value="#{emailBean.email}" >
<f:ajax event="blur" execute="@this"
render="emailInputMsg"></f:ajax>
</h:inputText>
</h:panelGroup>
<h:panelGroup id="emailRepeatBlock" layout="block">
<h:message id="emailRepeatMsg" for="emailRepeatInput"/>
<h:outputLabel value="Wiederholung-Email" />
<h:inputText id="emailRepeatInput"
value="#{emailBean.emailRepeat}" >
<f:ajax event="blur" execute="@this"
render="emailRepeatMsg"></f:ajax>
</h:inputText>
</h:panelGroup>
Now 2 things:
1. I want the equal validation only to happen on blur of the
emailRepeatInput
2. (nice to have) the equal error message only for repeat input
Is there a way to do this?
I have searched the ExtVal blog and the examples but I didn't find a
scenario like this.
regards
Björn