The user guide mentions how to do it.

http://jakarta.apache.org/tapestry/UsersGuide/validation.html


Basically don't use ValidField for T4.

Now all the normal form components have built in validators i.e. TextField, PropertySelection, Checkbox, etc.

 <component id="someField" type="TextField">
   <binding name="value" value="fieldValue"/>
   <binding name="validators" value="validators:required,email"/>
   <binding name="displayName" value="literal:some field"/>
</component>

If you have old T3 beans or custom ones you can use
<binding name="validators" value="validators:$beanName"/>

Which is mentioned very briefly in the docs.


----- Original Message ----- From: "Adrian Davis" <[EMAIL PROTECTED]>
To: "'Tapestry users'" <[email protected]>
Sent: Thursday, January 26, 2006 10:38 AM
Subject: TextField validators?


I'm trying to setup some validators in a small test application I'm writing. I have to say that as a newcomer the tapestry documentation leaves a lot to be desired. There seems to be a lot of conflicting information as parts are
updated for 4.0 and other parts aren't.  But on to my specific question...


This is an excerpt from the TextField component reference:

A TextField may be decorated by the Form's validation delegate, but does not have a validator, so is limited in editting properties types beyond string.
In most cases, the ValidField component is preferred.


And this is an excerpt from the ValidField component:

Warning
This component has been deprecated; Tapestry 4.0 adds even better support
for validation to TextField, TextArea and most other form element component.


And there's even a link to the TextField reference page in the warning. Is
there some documentation somewhere that describes how to do TextField
validation using the 4.0 "better support for validation".  Or am I looking
at the wrong reference?

Any help would be appreciated.

Thanks,
Adrian

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



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

Reply via email to