Hi Ed,
first we have to ensure that the existing UISelectItem(s) are passed correctly to ResponseWriter.startElement(), when rendering option tags (mojarra currently doesn't). This way, we can nest passthrough attributes inside f:selectItem(s).
So we should add the following sentence to vdldocs/facelets/h/selectManyListbox.html#option (Rendering the option elements):
The corresponding UISelectItem or UISelectItems of the current SelectItem must be passed to ResponseWriter.startElement(), when rendering an option element.
To enable passthrough attributes to the optgroup element we should add UISelectItemGroup (type and family "javax.faces.SelectItemGroup") with tag f:selectItemGroup. It should have UISelectItem(s) children.
Having this we can add the the following sentences to vdldocs/facelets/h/selectManyListbox.html#option (Rendering the option elements):
The corresponding UISelectItemGroup of the current SelectItemGroup must be passed to ResponseWriter.startElement(), when rendering an optiongroup element, if the SelectItemGroup is specified with an UISelectItemGroup component. Otherwise the corresponding UISelectItem or UISelectItems must be passed to ResponseWriter.startElement().
Ciao Frank
Am 25.06.2012 um 19:15 schrieb Edward Burns:
>>>>>> On Sat, 23 Jun 2012 16:23:35 +0200, Frank Caputo <frank_at_frankcaputo.de> said:
>
> PW> I do like the idea of not needing to revisit renderers to support
> PW> passthough attributes, and it maps well with the information Ed sent
> PW> earlier [1]. Having said that, there might be some complexities
> PW> with existing code. For example, looking at PrimeFaces, in
> PW> org.primefaces.component.inputtext.InputTextRenderer I noticed that
> PW> no component is passed to startElement. With Mojarra, the
> PW> com.sun.faces.renderkit.html_basic.MenuRenderer calls startElement
> PW> several times with the same component (once for "select" and again
> PW> for "option" and "optiongroup"). Not much can be done if the
> PW> component is not passed, but the menu case is particularly
> PW> interesting because I would expect passthough attributes and
> PW> overrides to apply to "select" but not "option" or
> PW> "optiongroup".
>
> PW> I think the renderer should pass the correct child (UISelectItem(s))
> FC> to the ResponseWriter. Having this, we could embed
> FC> f:passThroughAttributes inside the f:selectItem(s).
>
> FC> Unfortunately there is no corresponding component for
> FC> SelectItemGroup, so we can't passthrough attributes to the
> FC> optiongroup tag.
>
> FC> Should we spec this behavior and add a component for SelectItemGroup?
>
> Frank, can you please write some text that I can use as the starting
> point for the VDLDoc for whatever new tag(s) you think we need?
>
> Ed
>
> --
> | edward.burns_at_oracle.com | office: +1 407 458 0017
> | homepage: | http://ridingthecrest.com/
> | 18 Business days til JSF 2.2 Public Review to EG
>