David Graham wrote:

--- 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.


Is it really the Struts tag library's mantra to dictate that the tags should not be modified
externally to gain needed functionality ? By not providing hooks, wheather these are the
correct ones or not, isn't very developer friendly. A framwork can be developer friendly,
and well designed at the same time.


And It's not that the tags would be producing non standard HTML 4.01, it's that they would/could
add composite functionality over and above standard HTML that would still be 4.01 compliant.


I agree with what several other committers, that if developers want to step up
and show that they will help support those tags I'll vote for the ability to support these abilities,
inside the struts tags not just the hooks.


-Rob



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




Reply via email to