0

Options tried:-

  1. empty f:ajax with valueChangeListener
  2. f:ajax listener without valueChangeListener
  3. p:ajax works but do not get the selected values

    <p:selectCheckboxMenu id="originCommittee" value="#{floorsession.selectedOriginCommittees}" label="Origin Committee" multiple="true"
     filter="true" filterMatchMode="startsWith" panelStyle="width: 300px"
     valueChangeListener="#{floorsession.filterOriginCommitteeHeard}">

<f:ajax execute="@form"  />
<p:ajax event="change" immediate="true" process="@this" listener="#{floorsession.filterOriginCommitteeHeard}"/>
<f:selectItems value="#{floorsession.committees}"  var="comm" itemLabel="#{comm.committeeName}" itemValue="#{comm}"/>
</p:selectCheckboxMenu>
  • Hi, 1: it is a PrimeFaces selectOneMenu not a JSF one. 2: if 3 works, where is your [mcve] that shows you do not get the selected values? 3: Version info is missing of both PrimeFaces and the jsf implementation (which that is is also missing), cheers – Kukeltje Nov 26 '19 at 22:08
  • 4: `f:ajax` in a `p:` component is not advised (undefined behaviour) – Kukeltje Nov 26 '19 at 22:29
  • See https://stackoverflow.com/questions/25339056/understanding-primefaces-process-update-and-jsf-fajax-execute-render-attributes – Jasper de Vries Nov 27 '19 at 15:04

1 Answers1

0

<p:selectCheckboxMenu id="lastHeardInCommittee" value="#{floorsession.selectedLastHeardInCommittees}" label="Committee" multiple="true" 
   filter="true" filterMatchMode="startsWith" panelStyle="width: 300px"
   onHide="executeOnLastHeardOnHide();">
 <f:selectItems value="#{floorsession.committees}" var="comm" itemLabel="#{comm.committeeName}" itemValue="#{comm.committeeId}"/>
</p:selectCheckboxMenu>
<p:remoteCommand name='executeOnLastHeardOnHide' action="#{floorsession.filterLastHeardInResults}"/>

enter image description here

With onHide I am able to capture all the selected entries at once Now I want to handle the removal of selected entries?