Original report: primefaces/primefaces#9784
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:
<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>
The issue is id="test2" 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.
Original report: primefaces/primefaces#9784
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:
The issue is
id="test2"the user is expecting it to renderitemLabel="#{i.key} - #{i.value}"but it is ignored and just the underlying Java SelectItem value is rendered.