5 Replies Latest reply on Jun 6, 2008 8:07 PM by Daniel Hinojosa

    selectManyCheckbox getting the selected values

    Mounir Bakkali Newbie

      I have the following issue:


      Each user has roles.
      I want the admnistrator to be able to set the roles
      for everyone.


      I have a UserAdminAction that contains:



      @Stateful
      @Scope(ScopeType.SESSION)
      @Name("userAdmin")
      public class UserAdminAction implements UserAdmin {
      List<String> availableRoles;
      List<String> selectedRoles;
      ...
      }




      On the JSF, I have the following:


      <h:selectManyCheckbox value="#{userAdmin.selectedRoles}" style="border-top: 0px" >
      <s:selectItems value="#{userAdmin.availableRoles}" var="r" itemValue="#{r}" label="#{r}" />
      </h:selectManyCheckbox>




      The getSelectedRoles() method returns a List with the
      roles that the user has already... this works fine
      and the roles that the user already has are checked.


      The problem is when I add new roles (i.e. I select them),
      then the selectedRoles is not updated.


      As you have noticed the List is a list of String.
      Do I still need a converter?


      Any idea?