WhenIgeneratethejsfpagesfromentitiesclassbynetbeans,itautomaticallygeneratesthedatabasecrudinprimefacesifIprefer,butwhenIputsometablethathasrelationwithforeignkey,atthetimeofregisteringittakesthefieldinthiswaythroughaselectOneMenu(entitiesProductValue[idVend=2]),whereittakesthepath+theidofthefield,andassignstheidandmakestheregistrationaccordingtotheid,Iwanttodoforitgetthenameofthefieldandinserttheid,ieintheselectOneMenuwillbepresentedthenamewhenselectwillregistertheidofthatname.
<p:selectOneMenuid="idUsu" value="#{vendaProdutoController.selected.idUsu}" >
<f:selectItems value="#{usuarioController.itemsAvailableSelectOne}"
var="idUsuItem"
itemValue="#{idUsuItem}"/>
</p:selectOneMenu>
I tried to do this as follows, where it accesses the following path: salesProductController.selected.Product.ProductName, which in my logic took the product name, but in selectOne it 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 selectOneMenu to display the name correctly?