If you want to bind your field to a number with 10 digits, you should
not need to write your own validator nor use custom logic in your listener.
Try this:

<component id="customerNumber" type="TextField">
    <binding name="value" value="customerNumber" />
    <binding name="translator"
value="translator:number,pattern=0000000000"/>
    <binding name="validators"
value="validators:required,min=0,max=9999999999"/>
    <binding name="displayName" value="literal:Contract No."/>
</component>

Paul

Kent Tong wrote:
> spm <maillist <at> tapestryforums.com> writes:
>
>   
>> Here is what I would like:
>>
>> <component id="customerNumber" type="TextField">
>> <binding name="value" value="customerNumber" />
>> <binding name="validators" 
>> value="validators:required,minLength=10,maxLength=10,numeric,omitZero=false"/>
>> <binding name="displayName" value="literal:Contract No."/>
>> </component> 
>>     
>
> If your customerNumber is a string, then you may try:
>
> <binding name="validators"
>   value="validators:required,pattern=\d{10}"/>
>
> If it is a number, then you'll need to write your own validator.
>
> --
> Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>   

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to