This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSF and the fly likes JSF Error Messages Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "JSF Error Messages" Watch "JSF Error Messages" New topic
Author

JSF Error Messages

Nadine McKenzie
Ranch Hand

Joined: Feb 15, 2002
Posts: 53
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.
>


Nadine -SCJP, SCWCD, SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF Error Messages
 
Similar Threads
Problem with validation 'required' attributes
applying tooltip on error fields
Validating some extra fields of action form not in my jsp?
Struts Validator Configuration
more than html:error