You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by babus_18 <ba...@yahoo.com> on 2009/02/16 20:56:58 UTC
Validators of h:inputText not getting invoked value is ""
Hi,
I am using jsf api and impl 1.2._12.
I have the following facelet mark up:
<h:inputText id="testInput" value="#{testController.test}" required="false">
<f:validator validatorId="stateValidator"/>
</h:inputText>
The "stateValidator" is configured as follows in faces-config
<validator>
<validator-id>stateValidator</validator-id>
<validator-class>adc.validators.MultiFieldLengthValidator</validator-class>
</validator>
The validator is getting invoked with no issues when the value of the field
is anything other than "". But when the value is "", the validator does not
get invoked.
I am wondering if I am doing something wrong. Please advise on potential
solutions.
TIA,
Babu
--
View this message in context: http://www.nabble.com/Validators-of-h%3AinputText-not-getting-invoked-value-is-%22%22-tp22044582s134p22044582.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Validators of h:inputText not getting invoked value is ""
Posted by Kevan Miller <ke...@gmail.com>.
On Feb 16, 2009, at 2:56 PM, babus_18 wrote:
>
> Hi,
>
> I am using jsf api and impl 1.2._12.
>
> I have the following facelet mark up:
>
> <h:inputText id="testInput" value="#{testController.test}"
> required="false">
> <f:validator validatorId="stateValidator"/>
> </h:inputText>
>
> The "stateValidator" is configured as follows in faces-config
>
> <validator>
> <validator-id>stateValidator</validator-id>
>
> <validator-class>adc.validators.MultiFieldLengthValidator</validator-
> class>
> </validator>
>
> The validator is getting invoked with no issues when the value of
> the field
> is anything other than "". But when the value is "", the validator
> does not
> get invoked.
>
> I am wondering if I am doing something wrong. Please advise on
> potential
> solutions.
Babu,
I'm no subject matter expert (and from your version number, I'm not
sure you're actually using "Geronimo"), but believe that you are
describing the expected behavior when "required="false". If required
is false, validators are not executed for a null or empty string.
--kevan