Doesn't look too clean to me.. If you need those
non-standard attributes for specific tags (possibly with certain values), why
not just write a filter that would do an XSL transformation and add them to the
response?
Kalle
A couple days ago our project ran into the need to emit nonstandard HTML attributes to support a certain security-related feature. We ended up
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 23, 2005 8:19 AM
To: [email protected]
Subject: Nonstandard HTML attribute support
subclassing HtmlInputTextTag to add a setter/getter for the attribute. While it's not a lot of code, a "standard" method for adding these sorts of attributes
seems like it would be desirable.
I'll start by recognizing that I might be stepping into a religious battle over support for nonstandard HTML tags. If so, I apologize in advance ;>)
I'm also open to the idea that there's already a way to do this, but I haven't been able to find it. RTFM comments welcome.
--
The approach I'll propose for discussion is a new Tomahawk tag called t:nonstandard-attributes. Its children would be f:param elements that would specify name-value pairs to be added to the attribute list of its parent.
Sample usage would be:
<t:inputText id="credit_card_number" value="#{backingBean.creditCardNumber}">
<t:nonstandard-attributes>
<f:param name="autocomplete" value="false"
</t:nonstandard-attributes>
</t:inputText>
At first glance, this tag would modify the behavior of:
commandButton
commandLink
dataTable (for HTML table)
form
graphicImage
All input* tags
outputFormat (causes/modifies the span)
outputLabel
outputLink
outputText (causes/modifies the span)
panelGrid (for HTML table)
panelGroup (causes/modifies the span)
all select* tags
