You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by ch...@gmail.com on 2005/11/23 17:19:23 UTC

Nonstandard HTML attribute support

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