You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Madhavan Thirumalai <ma...@letsgaggle.com> on 2005/08/19 23:01:52 UTC
Client side validation sans component and sans JAVA generated html?
I am a Tapestry newbie ...
Is there any way to generate Javascript for client side validation without
having to write your own component as described in Chapter 8.2 of Tapestry
in Action. Can I simply register my own Javascript validators against a page
and figure out what the fields will be named?
Is there any way I can avoid writing my own renderComponent() method and
generating html in JAVA? I would prefer to keep all the stuff that's
visually displayed in the html files.
Sorry if this question smacks of complete ignorance. Any help would be
appreciated.
Thanks,
Madhavan
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Client side validation sans component and sans JAVA generated html?
Posted by Kent Tong <ke...@cpttm.org.mo>.
Madhavan Thirumalai <mad <at> letsgaggle.com> writes:
> I got my own validator to fire if I disabled clientScripting. But ideally,
> I'd like the best of both worlds. I'd like my validators to fire after the
> Tapestry generated validators have had their shot. If I enable
> clientScripting my validator doesn't fire. Any way to do this?
Then you should implmenet the Validator interface and the
FormComponentContributor interface. In particular, in your
renderContribution(), you can make use of the
FormComponentContributorContext argument passed to you to
add your validation script by calling its addSubmitListener()
method.
--
Author of e-book for learning Tapestry (www.agile
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: Client side validation sans component and sans JAVA generated html?
Posted by Madhavan Thirumalai <ma...@letsgaggle.com>.
Thanks Kent.
I got my own validator to fire if I disabled clientScripting. But ideally,
I'd like the best of both worlds. I'd like my validators to fire after the
Tapestry generated validators have had their shot. If I enable
clientScripting my validator doesn't fire. Any way to do this?
Madhavan Thirumalai
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Kent Tong
> Sent: Friday, August 19, 2005 6:57 PM
> To: tapestry-user@jakarta.apache.org
> Subject: Re: Client side validation sans component and sans JAVA generated
> html?
>
> Madhavan Thirumalai <mad <at> letsgaggle.com> writes:
>
> > Is there any way to generate Javascript for client side validation
> without
> > having to write your own component as described in Chapter 8.2 of
> Tapestry
> > in Action. Can I simply register my own Javascript validators against a
> page
> > and figure out what the fields will be named?
>
> You can use a Script component and put your script in a .script
> file. But encapsulating it in a component is a much better way
> IMO.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Client side validation sans component and sans JAVA generated html?
Posted by Kent Tong <ke...@cpttm.org.mo>.
Madhavan Thirumalai <mad <at> letsgaggle.com> writes:
> Is there any way to generate Javascript for client side validation without
> having to write your own component as described in Chapter 8.2 of Tapestry
> in Action. Can I simply register my own Javascript validators against a page
> and figure out what the fields will be named?
You can use a Script component and put your script in a .script
file. But encapsulating it in a component is a much better way
IMO.
> Is there any way I can avoid writing my own renderComponent() method and
> generating html in JAVA? I would prefer to keep all the stuff that's
> visually displayed in the html files.
Let your component (eg, Foo) extend BaseComponent instead of
AbstractComponent. Then put the html code in Foo.html.
--
Author of an e-Book for learning Tapestry (http://www.agileskills2.org/EWDT)
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org