9 Replies Latest reply on Mar 7, 2008 11:25 PM by nickarls

    Using checkbox in datatable

    dreidel18.dreidel18.yahoo.com

      Hi, I have a datatable with a column for checkboxes.



      <h:dataTable value="#{myList}" var="_list">
      <h:selectBooleanCheckbox value="#{chkbox[_list.id]}">
      </h:dataTable>

      <h:commandButton action="#{myAction.submit}">


      But the problem is my Map cannot get the values (selected checkboxes) when I submit the form.



      @Name("myAction")
      @Scope(CONVERSATION)
      public class MyAction implements Serializable{

      @Out(required=false)
      private Map<Integer, Boolean> chkbox = new HashMap<Integer, Boolean>();

      @End
      public void submit(){}

      }