title: primefaces dataTable selection Object type
body: <pre><code>@ManagedBean(name = "menuCtrl")
  @ApplicationScoped
  public class MenuControleur extends AbstractControleur implements Serializable {
  
  private static final Logger log = Logger.getLogger(ApplicationControleur.class);
  
  private PanierBeans[] selectedRep;
  
  public PanierBeans[] getSelectedRep() {
      return selectedRep;
  }
  
  public void setSelectedRep(PanierBeans[] selectedRep) {
      this.selectedRep = selectedRep;
  }
  
  // cache
  private List&lt;Spectacle&gt; spectacles;
  private List&lt;Representation&gt; representations;
  private Spectacle specSelec = new Spectacle();
  
  
  private List&lt;Artiste&gt; artistes;
  private List&lt;Representation&gt; representationsFiltrees;
  private List lignesSelec;
  
  public List getLignesSelec() {
      return lignesSelec;
  }
  
  public void setLignesSelec(List lignesSelec) {
      this.lignesSelec = lignesSelec;
  }
  </code></pre>
  
  <p>and in the facelet i have this table</p>
  
  <pre><code>&lt;p:dataTable id="dataTable" var="rep" value="#{menuCtrl.specSelec.representations}" widgetVar="representationsTable"   
                       emptyMessage="Pas de représentation trouvée avec les criteres précisés" filteredValue="#{menuCtrl.representationsFiltrees}" paginator="true" rows="10"
                       style="background: none"      &gt;  
  
              &lt;f:facet name="header"&gt;  
                  &lt;p:outputPanel&gt;  
                      &lt;h:outputText value="Search all fields:" /&gt;  
                      &lt;p:inputText id="globalFilter" onkeyup="representationsTable.filter()" style="width:150px" /&gt;  
                  &lt;/p:outputPanel&gt;  
              &lt;/f:facet&gt;  
  
  
              &lt;p:column id="photoArtiste"  headerText="Artiste"  &gt;  
                  &lt;ui:param name="imgPath" value="images:#{menuCtrl.specSelec.artiste.lienPhoto}.png" /&gt;
                  &lt;p:graphicImage value="#{resource[imgPath]}" /&gt;  
              &lt;/p:column&gt;
  
              &lt;p:column id="nomArtiste" filterBy="#{rep}"   
                        headerText="Artiste"  
                        filterMatchMode="contains"&gt;  
                  &lt;h:outputText value="#{menuCtrl.specSelec.artiste.nom}" /&gt;  
              &lt;/p:column&gt;
              &lt;p:column id="nomSpectacle" filterBy="#{rep}"   
                        headerText="Spectacle"  
                        filterMatchMode="contains"&gt;  
                  &lt;h:outputText value="#{menuCtrl.specSelec.nomSpectacle}" /&gt;  
              &lt;/p:column&gt;
  
              &lt;p:column id="addColumn" filterBy="#{rep.adresse}"  
                        headerText="Ville" footerText="contains"  
                        filterMatchMode="contains"&gt;  
                  &lt;h:outputText value="#{rep.salle.adresseSalle}" /&gt;  
              &lt;/p:column&gt;
  
              &lt;p:column id="dateDebutColumn"  headerText="Date" footerText="startsWith"&gt;
  
                  &lt;h:outputText value="#{rep.dateDebut}" 
                                id="popupDate"&gt; 
                      &lt;f:convertDateTime pattern="d/M/yyyy" /&gt; 
                  &lt;/h:outputText&gt;
  
  
              &lt;/p:column&gt; 
              &lt;p:column id="dispColumn"   
                        headerText="Disponibilité"&gt;  
                  &lt;p:inputText id="champDisBillets" value="100" size="5" readonly="true" /&gt;
              &lt;/p:column&gt;
              &lt;p:column id="qteBillets"   
                        headerText="Qte Billets"&gt;  
                  &lt;p:selectOneMenu value="#{buttonBean.number}"&gt;  
                      &lt;f:selectItem itemLabel="1" itemValue="1" /&gt;  
                      &lt;f:selectItem itemLabel="2" itemValue="2" /&gt;  
                      &lt;f:selectItem itemLabel="3" itemValue="3" /&gt;
                      &lt;f:selectItem itemLabel="4" itemValue="4" /&gt;  
                      &lt;f:selectItem itemLabel="5" itemValue="5" /&gt;  
                      &lt;f:selectItem itemLabel="6" itemValue="6" /&gt;
                  &lt;/p:selectOneMenu&gt;   
              &lt;/p:column&gt; 
              &lt;p:calendar value="#{calendarBean.date2}" id="popupCal" /&gt; 
  
              &lt;p:column id="priceColumn" filterBy="#{rep}"   
                        headerText="Prix" footerText="contains"  
                        filterMatchMode="contains"&gt; 
  
                  &lt;p:inputText id="prixBillets" value="#{rep.prix}" readonly="true" size="5"/&gt;  
              &lt;/p:column&gt;
          &lt;/p:dataTable&gt;
  </code></pre>
  
  <p>nom i want to add checkboxes but in that case i would have to add a selection attributes that point to one of the managed bean attributes, thing is the rows are populated with differents inds of objects so what type o object should in selection ?</p>