jsr344-experts@javaserverfaces-spec-public.java.net

[jsr344-experts] Re: [jsr344-experts mirror] Re: [1089-HTML5-data-*attributes] PROPOSAL

From: Frank Caputo <frank_at_frankcaputo.de>
Date: Wed, 16 May 2012 19:48:14 +0200

This is much easier.

+1

Am 16.05.2012 um 18:42 schrieb Andy Schwartz <andy.schwartz_at_oracle.com>:

> Ed -
>
> I find the use of JSON here very confusing and unnecessarily complex.
>
> Two simpler options that I would prefer:
>
> 1. Enhance f:attribute to allow pass-thru of data- attributes, eg:
>
> <h:outputText>
> <f:attribute name="data-andy-rocks" value="false"/>
> </h:outputText>
>
> Thinking the <f:attribute> handler would populate a map that hangs off of the component's attribute map. Renderers would be required to iterate over this map and blast out all of attributes.
>
> 2. Add a new f:dataAttribute tag, eg:
>
> If we prefer not to complicate <f:attribute>, we could do:
>
> <h:outputText>
> <f:dataAttribute name="andy-rocks" value="false"/>
> </h:outputText>
>
> With a similar implementation.
>
> Ideally either/both of these would support EL-binding, eg:
>
> <h:outputText>
> <f:dataAttribute name="andy-rocks" value="#{bean.doesAndyRockYet}"/>
> </h:outputText>
>
> Regarding:
>
>> If the view being rendered is not HTML5, the value of this attribute
>> must be ignored.
>
> I would lean towards passing these through regardless of the target markup language. Although data- attributes are not strictly valid pre-HTML5, simply dropping these might make life more difficult for an