• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF Error Messages

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
>
 
I'm not sure if I approve of this interruption. But this tiny ad checks out:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic