title: primefaces datatable with multiple row selection
body: <p>I want to select multiple rows from a primefaces datatable, i followed the examples in the showcase , but no results </p>
  
  <p>here is my XHTML:</p>
  
  <pre><code>&lt;p:dataTable id="tabJob" var="contenuJob" value="#{templateBean.contenuJob}" selection="#{templateBean.selectedRows}" 
  rowKey="#{templateBean.idJob}" style="margin-bottom:0"
  scrollable="true" scrollHeight="250" rowIndexVar="rowIndex" &gt;
  
                          &lt;p:column selectionMode="multiple" style="width:16px;text-align:center" /&gt;
                   &lt;f:facet name="header"&gt;  
                      selectionner les colonnes
                    &lt;/f:facet&gt;  
  
                  &lt;p:column headerText="#" style="width:3%"&gt; #{rowIndex+1}&lt;/p:column&gt;
                  &lt;p:columns value="#{templateBean.colonnes}" var="colonnes" columnIndexVar="ind" id="col#{ind}"&gt;
                          &lt;f:facet name="header"&gt;
                                &lt;h:outputText value="#{colonnes}"/&gt;
                          &lt;/f:facet&gt;#{contenuJob[ind]}
                  &lt;/p:columns&gt;
  
                  &lt;f:facet name="footer"&gt;  
                      &lt;p:commandButton process="tabJob" value="valider"    action="#{templateBean.validerSelection()}"/&gt;  
                  &lt;/f:facet&gt;  
  
          &lt;/p:dataTable&gt; 
  </code></pre>
  
  <p>and in my ManagedBean:</p>
  
  <pre><code>private ArrayList&lt;String&gt; contenuJob,selectedRows;
  .................
  public String validerSelection(){
  
  
          System.out.println("size de selectedRows ::"+selectedRows.size());
  
          return null;
      }
  </code></pre>
  
  <p>and the s.o.p only returns 1 which is the size, i've already tried rowSelectMode="add" in the datatable but it didn't change a thing </p>