Is there a way to let JSF do validations for my inputs but let me control how to display the validation errors? I want to avoid using h:message
I find it making my code too messy when I write a h:message component below every input components inside forms needing validation support. Since there are several forms on the page using h:messages is not an option as that would show the error messages of other forms as well. So I want to handle the error messages sent after validation to the presentation layer & do the errors presentation task myself using JS/Jquery. So how do I handle errors thrown by JSF validation service?
Just conditionally render the
<h:messages>based onUIForm#isSubmitted().Or just bring in some ajax magic and update the current form only instead of the entire view.
Create a custom component or renderer which replaces the
<h:messages>.