--- Sgarlata Matt <[EMAIL PROTECTED]> wrote: > OK, here's another idea. I searched the archives for it and couldn't > find > it. > > How about two simple changes: > 1) Add a new renderExtraAttributes() method that gives people the chance > to > throw non-standard HTML into their tags that extend from Struts tags.
I am -1 on the Struts tags supporting any non-standard HTML including providing the suggested hook method. Like Java itself, Struts aims to be a cross-platform tool. Adding support for non-standard HTML undermines that goal and promotes non-interoperability. I can't count the number of times I've been frustrated by webapps that require a particular browser that I'm not using. I absolutely don't want one of my favorite tools to support that kind of development. > Here > is a snippet from BaseFieldTag.java: > > <snip> > results.append("\""); > results.append(this.prepareEventHandlers()); > results.append(this.prepareStyles()); > results.append(this.getElementClose()); > > > <matts-idea> > results.append(renderExtraAttributes()); > </matt-sidea> > > return results.toString(); > </snip> > > The use cases for this are (a) to support the readonly attribute and At least the <html:text> tag already supports readonly. Are there other tags (where readonly is allowed) that are missing it? http://jakarta.apache.org/struts/userGuide/struts-html.html#text David > (b) > to > support the "attributes" extension that was shot down for inclusion in > the > out-of-the-box Struts <html> tags. > > 2) Instead of accessing instance variables directly, use getters. (I'm > not > sure if this will cause problems with the EL versions of tags... > thoughts > anyone?) > > <snip> > if (accept != null) { > results.append(" accept=\""); > //old way > //results.append(accept); > //new way > results.append(getAccept()); > results.append("\""); > } > </snip> > > If someone wanted to override the accept attribute so that it was always > equal to foo then they would be able to do so. A better use case would > be > overriding the onclick method so that it does something special like > display > a calendar popup. > > I apologize in advance if this has been discussed before. ([OT] I > really > wish there was an easier way to search the archives. I have resorted to > googling them, but it's still a pain.) > > Matt > ----- Original Message ----- > From: "Robert Leland" <[EMAIL PROTECTED]> > To: "Struts Developers List" <[EMAIL PROTECTED]> > Sent: Thursday, September 25, 2003 1:41 PM > Subject: Re: Editable Fields V/S Static Text > > > > Sgarlata Matt wrote: > > > > >Has anyone ever discussed adding a general-purpose "attributes" > attribute > to > > >the <html> tag library to support non-standard HTML like this? For > example, > > > > > > > > Yes, it was vetoed by several committers. Search the archives. > > > > > > --------------------------------------------------------------------- > > 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] > __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]