I use JSF with Primefaces. When I use
<h:selectOneListbox>
all objects are listed correctly, but when I replaced h with p,
<p:selectOneListbox>
nothing works.
Where is the error? I have listed the code below.
<p:selectOneListbox id="cmbProvince1" value="#{mohController.current.superArea}" disabled="#{mohController.modifyControlDisable}" style="size:5;height: 200px;">
<f:selectItems value="#{mohController.dpdhsAreas}" var="p" itemValue="#{p}" itemLabel="#{p.name}" />
</p:selectOneListbox>
<h:selectOneListbox id="cmbProvince" value="#{mohController.current.superArea}" disabled="#{mohController.modifyControlDisable}" style="size:5;height: 200px;">
<f:selectItems value="#{mohController.dpdhsAreas}" var="p" itemValue="#{p}" itemLabel="#{p.name}" />
</h:selectOneListbox>
The reason is that the Type of the collection used is DataModel, which works fine with the JSF, but not with PrimeFaces. Changing the type to the List solved the issue.