Paul Ferraro <pmf8 <at> columbia.edu> writes: > 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>
Well, if he'd like to treat say 123 as invalid because it only contains 3 digits, not 10, then this won't work. Setting the pattern to 0000000000 will only affect the formatting, but not the parsing. 123 will still be accepted as valid. -- Author of a book for learning Tapestry (www.agileskills2.org/EWDT) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
