Well, I'm working on a project and when saving a record using the selectOneMenu of primefaces, an Id is displayed instead of the field name that was selected, I need to know how to display only the field name.
Here's my xhtml:
<p:outputLabel for="tipoTratamentoCB" value="Tipo de tratamento:" />
<p:selectOneMenu id="tipoTratamentoCB"
value="#{guiaEncaminhamentoBean.guiaEncaminhamento.tipoTratamentoCB}"
style="width:185px">
<f:selectItem itemLabel="Hospitalização Diurna - HD" itemValue="0" />
<f:selectItem itemLabel="Hospitalização Noturna - HN" itemValue="1" />
</p:selectOneMenu>
My CBRC type variable is declared to be so in my class:
private String tipoTratamentoCB;
The problem is that I display in my xhtml the value that is saved in ivemValue in selectItem, I need to know how to display the value of the itemLabel, does anyone have any idea how to do this?