title: primefaces selectCheckboxMenu empty selected list
body: <p>I'm trying to get selected values from a selectCheckboxMenu, but always the selection list is empty. this's my jsf form:</p>
  
  <pre><code>&lt;h:form id="form"&gt;
                              &lt;p:dataTable id="singleDT" var="user" value="#{roleBean.users}"
                                  rowKey="#{roleBean.users}" rows="12" paginator="true"
                                  rowsPerPageTemplate="12,15,22" paginatorPosition="bottom"
                                  emptyMessage="Aucun compte présent." reflow="true"
                                  editable="false" selectionMode="single"&gt;
  
                                  &lt;p:column headerText="Login" filterBy="#{user.username}"&gt;
                                      &lt;h:outputText value="#{user.username}" /&gt;
                                  &lt;/p:column&gt;
  
                                  &lt;p:column headerText="Nom" filterBy="#{user.lastname}"&gt;
                                      &lt;h:outputText value="#{user.lastname}" /&gt;
                                  &lt;/p:column&gt;
  
                                  &lt;p:column headerText="Prénom" filterBy="#{user.firstName}"&gt;
                                      &lt;h:outputText value="#{user.firstName}" /&gt;
                                  &lt;/p:column&gt;
  
                                  &lt;p:column headerText="Email" filterBy="#{user.emal}"&gt;
                                      &lt;h:outputText value="#{user.emal}" /&gt;
                                  &lt;/p:column&gt;
  
                                  &lt;p:column headerText="Affécter Roles"&gt;
  
  
                                      &lt;p:selectCheckboxMenu id="menu"  value="#{roleBean.rolesselected}"
                                           label="Roles"
                                          filter="false" filterMatchMode="startsWith"
                                          panelStyle="width:135px" converter="#{roleconvertor}"  immediate="true" &gt;
                                          &lt;f:selectItems value="#{roleBean.roles}" var="n"
                                              itemValue="#{n}" itemLabel="#{n.description}"
                                              itemDescription="#{n.rolename}"  /&gt;
  
                                      &lt;/p:selectCheckboxMenu&gt;
  
  
  
                                  &lt;/p:column&gt;
                                  &lt;p:column width="90"&gt;
                                      &lt;p:commandButton styleClass="ui-yelbutton"   immediate="true" process="@form" value="Valider"
                                          title="Remove"
                                          ajax="true" action="#{roleBean.addrole(user)}" /&gt;
                                   &lt;/p:column&gt;
  
                              &lt;/p:dataTable&gt;
  
                          &lt;/h:form&gt;
  </code></pre>
  
  <p>Here's the managedBean related. when I run the jsf page I show the list of value and I can check it. also tne converter was worked but when I try to test a size of selectedrole it's always 0.</p>
  
  <pre><code>public class RoleBean implements Serializable {
  @Autowired 
  UserCatalogueService userservice;
  @Autowired
  Roleservice roleservice;
  List&lt; Role&gt; roles;
  
  List&lt;UserCatalogue&gt; users  ;
  private static final long serialVersionUID = 1L;
  
  String notification;
  
  private List&lt;Role&gt; rolesselected  = new ArrayList&lt;Role&gt;();  
  
  
  
  @PostConstruct
  public void init() {
  
      roles=roleservice.findAll();
  
  }
  
  public List&lt;Role&gt; getRolesselected() {
      return rolesselected;
  }
  
  
  
  public void setRolesselected(List&lt;Role&gt; rolesselected) {
      this.rolesselected = rolesselected;
  }
  
  
  
  public List&lt;UserCatalogue&gt; getUsers() {
      List&lt;UserCatalogue&gt; users= userservice.findAll();
      List&lt;UserCatalogue&gt; users1= userservice.findAll();
      users1.clear();
      for(int i=0; i&lt; users.size(); i++)
      {
          if(users.get(i).getRoles().size()==0)
          {
              System.out.println(users.get(i).getFirstName()+   "est un nouvel utilisateur");
              //users.remove(i);
              users1.add(users.get(i));
          }
      }
  
      return users1;
  }
  
  
  
  public String getNotification() {
      notification=getUsers().size()+"  Alerts";
      return notification;
  }
  
  public void setNotification(String notification) {
      this.notification = notification;
  }
  
  
  public void setUsers(List&lt;UserCatalogue&gt; users) {
      this.users = users;
  }
  
  public List&lt;Role&gt; getRoles() {
      return roleservice.findAll();
  }
  public void setRoles(List&lt;Role&gt; roles) {
      this.roles = roles;
  }
  
  
  
  
  
  
  public void addrole( UserCatalogue user)
  {
  
  
          System.out.println("the size of list is   "+rolesselected.size());
  
  
  }
  </code></pre>
  
  <p>}</p>