[
https://issues.apache.org/jira/browse/MYFACES-3879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13994989#comment-13994989
]
Leonardo Uribe commented on MYFACES-3879:
-----------------------------------------
I have checked the examples and they work as it was fixed. For example:
<h:selectManyMenu id="mmenu" pt:data-many="many">
<f:selectItem itemValue="One"/>
<f:selectItem itemValue="Two" pt:title="Title Two"/>
</h:selectManyMenu>
render something like this:
<select id="form:mmenu" name="form:mmenu" multiple="multiple" size="1"
data-many="many">
<option value="One">One</option>
<option value="Two" title="Title Two">Two</option>
</select>
It is clear it doesn't work for h:selectOneRadio or h:selectManyCheckbox, but
we cannot change that behavior because there is a TCK test that pass the parent
component for passthrough instead f:selectItem instance. If your code is
different, could you please provide the example, so we can check if there is
still a bug?
> Passthrough attributes for f:selectItem and f:selectItems should be rendered
> by associated components
> -----------------------------------------------------------------------------------------------------
>
> Key: MYFACES-3879
> URL: https://issues.apache.org/jira/browse/MYFACES-3879
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-344
> Reporter: Leonardo Uribe
> Assignee: Leonardo Uribe
> Fix For: 2.2.3
>
>
> Reported by Sebastian Mellmann:
> Hello everyone,
>
> I have just run into a problem where the 'title' attribut is not being
> rendered using the <h:selectOneMenu> tag.
> Used version is MyFaces Core 2.2.2
>
> I had a look into the source code and the following changes seem to fix the
> problem:
>
> Class: org.apache.myfaces.shared.renderkit.html.HtmlRendererUtils
> Method: renderSelectOptions (Line 521)
> Code changes listed on pastebin: http://pastebin.com/SHLKxi5H
>
> Can someone confirm this, because I wanted to ask the ML first before opening
> an issue via Apache JIRA for MyFaces?!
>
> Thanks and regards,
> Sebastian
> The problem is not the title fix, is that passthrough attributes must work
> for components created by effect of f:selectItem and f:selectItems. There is
> a line in the renderkit javadoc of javax.faces.SelectMany/javax.faces.Listbox
> that says:
> "... In both the case of the "option" element or the "optgroup"
> element, the implementation must pass the UISelectItem or
> UISelectItems corresponding to the SelectItem bean to the call to
> ResponseWriter.startElement(). ..."
> I tested against Mojarra 2.2.6 and it is correct. But Mojarra has a bug in
> this part, because components like h:selectManyCheckbox or h:selectOneRadio
> should work just the same, but in this case a set of "input" html tags are
> rendered instead. It is clear the renderkit javadoc reference how the
> "option" is rendered, so we should follow the spirit of the spec in this
> part, which is allow to define passthrough attributes for f:selectItem and
> f:selectItems.
--
This message was sent by Atlassian JIRA
(v6.2#6252)