I've done number validation this way :

<component type="TextField" id="cap">
    <binding name="value" value="ognl:cap"/>
    <binding name="displayName" value="literal:C.A.P."/>
    <binding name="validators" value="validators:required,min=10000"/>
    <binding name="translator" value="translator:number"/>
</component>

you used the binding name "translators" instead if  "translator"
hope this help

Paolo

On 8/17/05, David Syer <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I must be missing something.  I cannot see how to use the new validators=
> framework to simply ensure that a TextField represents a number.  There is
> no validator in the forms/validate package that looks like to old "int"
> validator in a ValidField.
> 
> I have successfully made a "required" validator reject a page with an empty
> text field:
> 
>     <component id="increment" type="TextField">
>         <binding name="validators" value="required" />
>         <binding name="clientValidationEnabled" value="true"/>
>         <binding name="displayName" value="message:increment" />
>         <binding name="value" value="wrapper.increment" />
>     </component>
> 
> and I can extend the validators binding to "required,maxLength=2" to accept
> only two digits.  But I cannot see how to reject an invalid number.
> 
> Also if the validators are "required,max=10" then the Max validator barfs
> (ClassCastException).  Is this a bug or am I dong something wrong?
> 
> By the way, I have tried adding a translators binding to the field viz:
> 
>         <binding name="translators" value="translator:number" />
> 
> And this has no discernable effect.
> 
> Dave.
> 
> This email and any files transmitted with it are confidential and
> proprietary to Algorithmics Incorporated and its affiliates
> ("Algorithmics").  If received in error, use is prohibited.  Please destroy,
> and notify sender.  Sender does not waive confidentiality or privilege.
> Internet communications cannot be guaranteed to be timely, secure, error or
> virus-free.  Algorithmics does not accept liability for any errors or
> omissions.  Any commitment intended to bind Algorithmics must be reduced to
> writing and signed by an authorized signatory.
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to