I'm using h:selectOneMenu and I want to get not the ID value, but the label. In the backing bean I create SelectItem objects which are taken for loading the h:selectOneMenu.
new SelectItem("id", "label");
My view code:
<h:selectOneMenu value="#{Metadata.thema}">
<f:selectItems value="#{ThemaBean.themes}" />
<f:valueChangeListener type="com.schober.events.SelectThemaEvent" />
</h:selectOneMenu>
The code here sets Metadata.thema with the "id", but I need to set the "label". I tried with label="#{Metadata.thema}" but it does not work for me.