I use client-side validation with JSR-303 (bean validation) constraints as in the Richfaces 4 showcase
If I add a validation constraint in the validation bean like
@Pattern(regexp = "^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[a-zA-Z]{2,4}$", message = "Bad email")
private String email;
an error message would be triggered.
How can I trigger infos etc with client side validation like I would do in case of server side validation with a bean method like
public void validateEmail(FacesContext context, UIComponent toValidate, Object value) {
...
((UIInput) toValidate).setValid(true);
FacesMessage message = new FacesMessage("Looks good!");
message.setSeverity(message.SEVERITY_INFO);
context.addMessage(toValidate.getClientId(context), message);
...
}
Thanks!