You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by David Cypers <dc...@jcs.be> on 2003/09/25 10:12:43 UTC
How can I extend a Struts tag?
Hi there,
I would like to extend the struts <html:text> tag, so I can add a date
chooser popup next to it. I would do this by creating a custom tag, e.g.
<html:datechooser> which adds some extra functionality (and a
javascript) to the existing <html:text> tag. Can somebody tell me which
is the best way to do this? I allready searched the archives, but didn't
find anything that could help me.
Any help appreciated.
With kind regards,
David
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org
Re: How can I extend a Struts tag?
Posted by Chris Gastin <ch...@gastin.com>.
David,
You could extend org.apache.struts.taglib.html.TextTag. Add datechooser
atribute to your new class. Override the doStartTag() method. In the new
doStartTag method first call super.doStartTag() so you maintan the current
functionality then put any specific code for adding the datechooser . Then
you will need to add the datechooser attribute to the tld file, or create a
custom tld for this new custom tag.
Chris
----- Original Message -----
From: "David Cypers" <dc...@jcs.be>
To: <st...@jakarta.apache.org>
Sent: Thursday, September 25, 2003 3:12 AM
Subject: How can I extend a Struts tag?
> Hi there,
>
> I would like to extend the struts <html:text> tag, so I can add a date
> chooser popup next to it. I would do this by creating a custom tag, e.g.
> <html:datechooser> which adds some extra functionality (and a
> javascript) to the existing <html:text> tag. Can somebody tell me which
> is the best way to do this? I allready searched the archives, but didn't
> find anything that could help me.
>
> Any help appreciated.
>
> With kind regards,
> David
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org