• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF Error Messages

Nadine McKenzie
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a variety of error messages I display on my form to handle required and/or invalid input.

1- Most of my validation is handled by a custom validator that takes regex (e.g. RegexValidator implements Validator, StateHolder {...})
2- In my form fields I have added <h:inputText required="true" requiredMessage="Customer Phone Number.... />
3- for cross field validation, I added the validation in my bean to check for required fields (e.g. a field(s) becomes required when another field gets filled in). The bean performs an addMessage and page navigation. In addition, some of those fields have my custom validator.

Hopefully this gives you an idea of the diversity of messages.

My error messages appear in piecemeal fashion. Then as the first batch of errors are fixed, the next batch displays, and so on.

My question is how do I get all the error messages to appear at once. I'm ok with "required" messages appearing first and then "invalid" appearing in a second batch but that is as far as I'd like to go. I know I can move everything over to my bean layer but I don't want take that route because I'd be giving up ease of use and reuse.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic