0
votes

I have a selectOneMenu with twice the same value. When i choose item "One" and then try to change to item "Two", nothing happens. I unterstand that the values are the same, but i would like the correct Label to be displayed.

<p:selectOneMenu value="#{myBean.selectedValue}">  
    <f:selectItem itemLabel="One" itemValue="1" />
    <f:selectItem itemLabel="Two" itemValue="1" />
    <f:selectItem itemLabel="Three" itemValue="3" />
</p:selectOneMenu>

But if i select "Three", it works corectly. The Label changes.

i Use Wildfly 8.2 and the PF v5.1.13

1

1 Answers

1
votes

Sorry, but this is impossible and a very, very uncommon usecase

Html is designed to have unique values in a select... Think of it, If you preselected '1' from e.g. a database, which label should be shown? 'One'? or 'Two'? Non-unique labels works for the server, but that is confusing for the client. So having both 'unique' is not weird