| Author |
Multiple validators for single input text
|
tom davies
Ranch Hand
Joined: Apr 27, 2012
Posts: 168
|
|
I have a form with a number of input values. i want to be able to perform multiple validations on each input text. Currently all fields must have a value in, this works fine and a message is displayed if no value is found. I also want to apply a number of other validations such as validate length. i have tried using the code below but the form still submits.
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14480
|
|
WHERE did you get these validators
And why would you want a "required" validator when "required" is built into the parent tag to begin with?
If JSF doesn't understand an element, it ignores it, so unless you have real validators attached to those tags, they won't do anything.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
tom davies
Ranch Hand
Joined: Apr 27, 2012
Posts: 168
|
|
The validators i found form here.
http://www.jsftoolbox.com/documentation/help/12-TagReference/core/f_validator.html
Are these not correct?
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14480
|
|
OK. That "validateRequired" threw me. It seems redundant. And, in fact, the Oracle docs indicate that all it does is do the same thing as 'required='true"'. It also might be new to JSF2, since I haven't seen it before.
Speaking of JSF2, I noticed that the underlying Java class (EditableValueHolder) has 2 different validator properties, one for a single validator and one for a collection of validators. No indication of what release the multiple-validator property was added at, though. If you're using a JSF v1 implementation, that might explain things.
|
 |
 |
|
|
subject: Multiple validators for single input text
|
|
|