0
Well, I am working on a project and when saving a register using selectOneMenu of the primefaces, an Id is being displayed instead of the field name that was selected, I need to know how to display only the field name.
Here is 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 variable typeTreatmentCB is declared 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, need to know how to display the value of itemLabel, someone has idea of how to do this?