0
When I send jsf pages from entities class by net Beans, it generates crud automatically from the database even in primefaces if I prefer, but when I put some table that has foreign key relation, at the time of making a registration it takes the field this way through a selectOneMenu( entities.Vendaproduto[ idVenda=2 ] ), where it takes the path + the field id, and assigns the id and makes the registration according to the id, I want to make it take the field name and enter the id, ie in selectOneMenu will be presented the name when selector will register the id of that name.
<p:selectOneMenu id="idUsu" value="#{vendaProdutoController.selected.idUsu}" >
<f:selectItems value="#{usuarioController.itemsAvailableSelectOne}"
var="idUsuItem"
itemValue="#{idUsuItem}"/>
</p:selectOneMenu>
I tried to do the following way, where he accesses the following route salesProductController.selected.idProduct.productProduct, which in my logic took the name of the product but in Lectone appears empty.
<p:selectOneMenu id="idUsu" value="#{vendaProdutoController.selected.idUsu}" >
<f:selectItems value="#{vendaProdutoController.selected.idProduto.nomeProduto}"
var="idUsuItem"
itemValue="#{idUsuItem}"/>
</p:selectOneMenu>
how do I get the name correctly in selectOneMenu?
obg just put the following line : itemLabel="#{idUsuItem.nome}", sorry the return delay was in travel
– Fernando josé