I am using the selectCheckboxMenu to enable multiple users be selected. What I am trying to achieve is that, every time the user does a selection, the event will call the listener and pass in the selection as a parameter. Something like this
<p:selectCheckboxMenu id="user" value="#{userBean.selectedUserList}"
multiple="true" filter="true" filterMatchMode="contains">
<f:selectItems value="#{userBean.users}" var="selectedUser"
itemValue="#{selectedUser}"/>
<p:ajax event="change"
listener="#{userBean.addThisUserIntoAnotherList(selectedUser)}"/>
</p:selectCheckboxMenu>
I have tried to add the var="selectedUser" in the selectCheckBoxMenu tag instead but both return null as the parameter.