You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Volodymyr Siedlecki (Jira)" <de...@myfaces.apache.org> on 2023/02/13 17:18:00 UTC

[jira] [Commented] (MYFACES-4560) Faces Issue #1791 SelectItems rendering

    [ https://issues.apache.org/jira/browse/MYFACES-4560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17688036#comment-17688036 ] 

Volodymyr Siedlecki commented on MYFACES-4560:
----------------------------------------------

Problem looks to occur around here: 

[https://github.com/apache/myfaces/blob/4a996076a298b3767dab5e16fd312d5221e6b14a/api/src/main/java/jakarta/faces/component/_ComponentAttributesMap.java#L329]

Call originates here: 
[https://github.com/apache/myfaces/blob/89c747e85615e3f33265e664c8361789f38ea7db/api/src/main/java/org/apache/myfaces/core/api/shared/SelectItemsUtil.java#L82]

> Faces Issue #1791 SelectItems rendering
> ---------------------------------------
>
>                 Key: MYFACES-4560
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4560
>             Project: MyFaces Core
>          Issue Type: Improvement
>    Affects Versions: 2.3.10, 2.3-next-M7, 3.0.2, 4.0.0-RC4
>            Reporter: Melloware
>            Priority: Major
>
> See; [https://github.com/jakartaee/faces/issues/1791]
>  
> The component should render the itemLabel as instructed by the provided EL, even if the backed data type is SelectItem. The default rendering should only be done when the attribute is missing.
> Example:
> {code:java}
>         <h:form id="frmTest">
>             <p:selectOneMenu id="test1">
>                 <f:selectItems value="#{testView.items}" var="i" itemValue="#{i.value}" itemLabel="#{i.value} - #{i.label}" />
>             </p:selectOneMenu>
>             <p:selectOneMenu  id="test2">
>                 <f:selectItems value="#{testView.items2}" var="i" itemValue="#{i.key}" itemLabel="#{i.key} - #{i.value}" />
>             </p:selectOneMenu>
>             <p:selectOneMenu  id="test3">
>                 <f:selectItems value="#{testView.items}" />
>             </p:selectOneMenu>
>             <p:selectOneMenu  id="test4">
>                 <f:selectItems value="#{testView.items2}" />
>             </p:selectOneMenu>
>         </h:form>{code}
> The issue is `id="test1"` the user is expecting it to render `itemLabel="#\{i.key} - #\{i.value}"` but it is ignored and just the underlying Java SelectItem value is rendered.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)