• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting Range validators on text fields through Managed Bean declarations  RSS feed

 
Swapna Gouri Kalanidhi
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,

I'm new to JSF and trying to learn the concepts through examples. I have an application where I would like to validate the user input on a JSP page. I'm using validateLongRange tag to validate 3 fields. Each field is having a maximum and a minimum value and I want to fetch these values from the faces-config.xml

How do I declare the maximum and minimum ranges in the XML? As there are 3 fields, how to identify the max and min of each field in the XML? Is there a way out for this or do I need to hard-code the max/min values in the JSP page? Can anyone please help me in this regards?

Thanks!
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Faces-config wasn't really intended to be used that way. You can add new validators to the system using faces-config, but actual per-instance parameters are expected to appear on the items that actually use them.

You could kind of fake it by subclassing the standard validator, but since faces-config doesn't permit you to add arbitrary XML to itself, the actual values would need to be stored somewhere else.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!