I'm trying to build a form with a particular validation message architecture and can't figure out how to do it.
Here is what I want:
- To have the validation message display next to the erroneous field
- Have a generic message explaining that there is an error somewhere on the form and to check for the errors to correct.
My form can have up to 50 fields and they don't all fit in one page. Therefore, if the user clicks on the
Submit button at the bottom of the page, he will not see the messages that are next to the erroneous fields higher on the page (he will therefore not know what to do)
I have tried using something like h:messages but this will display the list of errors in my page. If the user has 10 or 15 errors it'll be a horrible display. I'd rather have a unique message stating:
There are errors in the form. Please correct them before re-submitting the form.
I probably need to find a way to programmatically add a global message through my action bean but I have no clue how...
Any help would be greatly appreciated.