There is currently no way to set the severity of a RichFaces CSV message. You'll have to file a feature request via jira requesting such a feature:
Richfaces 4: How to set severity class of messages triggered with client side validation
-
29-05-2022 - |
Question
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!
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow