[
https://issues.apache.org/jira/browse/MYFACES-3901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14037795#comment-14037795
]
Leonardo Uribe commented on MYFACES-3901:
-----------------------------------------
I have checked it and it looks like an spec issue. Mojarra also does not do
anything with f:selectItems and itemDescription. But taking a look at the
renderkit spec javadoc of javax.faces.SelectMany/javax.faces.Listbox in the
section "Rendering the "option" elements" it says this:
"... If the current child is a UISelectItem create a SelectIteminstance from
its itemValue, itemLabel, itemEscaped, and itemDescription properties, add it
to the list. If the current child is a UISelectItems instance, call its
getValue() method. If the result is a SelectItem bean, add it to the list. If
the result is an array of SelectItem beans, add each one to the list. If the
result is a Collection of SelectItem beans, add each one to the list. If the
result is a Map, create a SelectItem bean for each entry in the Map using the
key as the label, the value as the value, and null as the description. ..."
I tried pt:title with the latest snapshot and it works. I have created this
issue to follow this one:
https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1285
I cannot fix it until get a response from the spec side about how this should
work.
> f:selectItems ignore itemDescription within h:selectOneListbox
> --------------------------------------------------------------
>
> Key: MYFACES-3901
> URL: https://issues.apache.org/jira/browse/MYFACES-3901
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.2.3
> Environment: java 7, tomcat 7
> Reporter: Rene O
> Priority: Minor
>
> I have a <h:selectOneListbox> with underlying List:
> {code}
> List<SelectItem> mylist = new ArrayList<SelectItem>();
> mylist.add(new SelectItem("testvalue", "testlabel","testdescription"));
> {code}
> I want to show a tooltip over any option of a selectbox.
> Therefore I tried two options:
> 1.
> {code}
> <h:selectOneListbox value="#{bean.myvalue}" ...>
> <f:selectItems value="#{bean.mylist}" var="item"
> itemValue="#{item.value}" itemLabel="#{item.label}"
> itemDescription="yyy#{item.label}"/>
> </h:selectOneListbox>
> {code}
> 2.
> {code}
> <h:selectOneListbox value="#{bean.myvalue}" ...>
> <f:selectItems value="#{bean.mylist}" var="item"
> itemValue="#{item.value}" itemLabel="#{item.label}"
> passtrough:title="yyy#{item.label}"/>
> </h:selectOneListbox>
> {code}
> Option 1 ignores itemDescription. Only label and value are rendered.
> Option 2 renders title attribute, but fills title only with "yyy" and ignores
> value of #{item.label}
> I think, that this behaviour is a bug.
--
This message was sent by Atlassian JIRA
(v6.2#6252)