>From: "Rahul Akolkar" <[EMAIL PROTECTED]> 
>
> On 10/6/06, Gary VanMatre wrote: 
> > >From: "Wendy Smoak" 
> > > 
> > > On 10/6/06, Gary VanMatre wrote: 
> > > 
> > > > The registered validator-id is "org.apache.shale.CommonsValidator". 
> > > 
> > > Thanks Rahul and Gary. :) Progress! No errors, at least. 
> > > 
> > > But I don't see the "Effective Date is required" error message when I 
> > > submit the form. 
> > > isn't doing anything. 
> > > 
> > > Any ideas? 
> > 
> > Yeah, this is one of those odd ones. In vanilla jsf, the components that 
> > hold 
> editable values have a isRequired attribute. This one boolean is an implicit 
> validator. There are a couple areas that commons validator and JSF validators 
> don't align and this is one. 
> > 
> 
> 
> And whats the other one? (sorry, just easier to ask ;-). 
> 

JSF converts the data type before validation.  The converter's are an
implied validation rule.

There is dual processing server side for some of the commons validator 
rules like "integer". The canned server side rules assume the submitted 
value is a String.

<validator name="integer" 
classname="org.apache.commons.validator.GenericValidator"
   method="isInt"
   methodParams="java.lang.String"
   msg="errors.integer"
   jsFunctionName="validateInteger"

The component's value passed to the JSF validate method will most likely 
be the target type of the property of the backing bean. We actually have 
to convert from the int type to a String to invoke the "isInt" method.


> -Rahul 
> 

Gary

> 
> > To toggle on the server side "normal" required field validation, the 
> ValidatorScript component set the flag. So you need to add the 
> ValidatorScript 
> to your page. 
> > 
> > See method "findCommonValidators". 
> > 
> http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java
>  
> /org/apache/shale/validator/faces/ValidatorScript.java?view=markup 
> > 
> > 
> > 
> > > -- 
> > > Wendy 
> > 
> > Gary 
> > 

Reply via email to