If required=true and no data is provided, then validation isn't
checked (there's nothing to validate).  Instead, the component will
throw a validation exception.

If required=true and data is provided, then your validator will be run.

-Mike

On 9/16/05, Zhong Li <[EMAIL PROTECTED]> wrote:
> I have a issue here, I define a validate method in backing bean
> "dealerPricing", we need validate force user must input at least 2 non space
> letters, otherwise we may have legal issue, like somebody enter spaces
> instead enter nothing. So we can't use default request validator. I made a
> validator in bean. But we found my validator will never be called if we put
> required="ture"; if I remove required="true", it will never be called when
> user enter nothing. I don't want create a customized validator for this
> "simple" issue. 
>  
>      <h:inputText id="whoShopped"
>       value="#{dealerPricing.dealerVehicle.whoShopped}" 
>       validator = "#{dealerPricing.validateWhoShopped}"
>       required="true"
>       rendered="#{!dealerPricing.isAA}"/>
>  
>  
>  
>  Thanks.
> 
> -- 
> Zhong Li
> 
> WebJabber.Net

Reply via email to