1
I am trying to use a Primefaces type selector for my project. Its functionality is the following: I want to register an object of the type Discipline in DB, hence I need the selector to include an object of the type Teacher in the discipline, not to effect the inclusion of the data of the object type Teacher. I am unable to recover the name of all teachers to show on the selector when making the choice. Any hint???
<h:outputLabel value="Selecionar um Professor" />
<p:selectOneMenu id="selectedProf" value="#{selectedProf.recuperarTodosProfessores}" label="Select" effect="fold" editable="true" panelStyle="width:250px">
<f:selectItem itemLabel="Selecionar" itemValue="" />
<f:selectItems value="#{curs.professor}" />
</p:selectOneMenu>
<p:commandLink value="Adicionar" update="display1" />
<p:outputPanel id="display1" style="width:250px;padding-left: 5px;margin-top: 10px">
<p:dataList value="#{discip.professor}" var="curso">#{professor}</p:dataList>
</p:outputPanel>
In this case I have to rescue the list of objects of the type Teacher and show in the selector, appearing only the name of the Teacher to select and add in the teacher attribute of the class Discipline.
Adelino, put this info in the question by asking
edit
in the post. If you need help formatting we help you. And delete the comment here because it belongs to the question.– Sergio
I added to the question see if something is missing and delete the comments to get cleaner.
– Sergio