Since Struts 1.2.5 the html tags have had some re-factoring that makes it
easier to create your own custom version. All you need to do is extend the
TextTag, add appropriate getter/setter methods for a new "autocomplete"
property and override the prepareOtherAttributes() method to output your
additional attribute:

    protected void prepareOtherAttributes(StringBuffer handlers) {
        prepareAttribute(handlers, "autocomplete", getAutocomplete());
    }

You will also either need to modify the struts tld to point to your custom
tag and add your additional attribute - or create your own tld for the
custom tag.

Bug 1598 talked about adding the kind of facility you mention, but no-ones
done anything about it and there are other bug tickets which are related:

http://issues.apache.org/bugzilla/show_bug.cgi?id=1598
http://issues.apache.org/bugzilla/show_bug.cgi?id=29379
http://issues.apache.org/bugzilla/show_bug.cgi?id=32215

Niall

----- Original Message ----- 
From: "Tomasz Nazar" <[EMAIL PROTECTED]>
Sent: Monday, May 09, 2005 7:15 PM


> On Mon, May 09, 2005 at 02:02:52PM -0400, Benedict, Paul C wrote:
> > Tomasz,
> >
> > If you need to output additional attributes, you don't use Struts to
write
> > that particular tag. You are not forced to use Strut's <html:*> tags.
> > Consider vanilla HTML -- the good ol' days -- and use EL to get what you
> > want from Struts.
>
> That's the way it works now. But, you know I like my work to be
> "consistent".
> I even don't like to use <%= .. %>. I treat Struts as a high level web
> framework and every exception (like "autocomplete") just isn't right..
>
> Anyway.. are there any efforts to introduce "options" or
> "autocomplete" attributes to those tags like T. Husted suggested?



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

Reply via email to