I can't find how to persist the list of elements (target) choosen in a primefaces picklist.
<p:pickList id="pojoPickList" value="#{associationMBean.allVisas}" itemValue="#{visa}" itemLabel="#{visa.visaNum}" var="visa" style="width: 400px !important" converter="com.gis.visasmarketing.objectConverters.VisaConverter" required="true" showSourceControls="false" showTargetControls="false" showCheckbox="true"
showSourceFilter="true" showTargetFilter="true" filterMatchMode="contains" >
<f:facet name="sourceCaption">All Visas</f:facet>
<f:facet name="targetCaption" >Selected Visas</f:facet>
<p:ajax event="transfer" listener="#{associationMBean.onTransfer}" />
<p:column style="width:75%;">
#{visa.visaNum} #{visa.traveller.firstName} #{visa.traveller.lastName}
</p:column>
</p:pickList>
This picklist is working fine: it move values from one list to another list. But i don't know how to get the elements selected in the target list to persist them with a command button.
Any help please??
The p:ajax is OK, if it's not calling the bean, try to update your PF to 4.0
If you want to get the picklist target on your commandbutton, just use : picklist.getTarget();
If you want to do that in your onTransfer event, do the following: