title: Primefaces dataTable multiple selection same object
body: <p>I'm having a problem with the dataTable multiple selection with checkbox (like the second one: <a href="http://primefaces.org/showcase/ui/datatableRowSelectionRadioCheckbox.jsf" rel="nofollow">http://primefaces.org/showcase/ui/datatableRowSelectionRadioCheckbox.jsf</a>).
  When I try to execute a method in my backingBean, the selected items always comes with the right size, but, with the same object. 
  Example: I select in my dataTable three Messages: Message 1, Message 2 and Message 3. When I execute my method in the JSF page my selected items comes like this:</p>
  
  <pre><code>Messages[0] = Message 1
  Messages[1] = Message 1
  Messages[2] = Message 1
  </code></pre>
  
  <p>Here is my JSF Page:</p>
  
  <pre><code>&lt;p:dataTable id="mensagensLidas" var="msg" value="#{mensagensBean.msgGrupoModel}" 
  paginator="true" rows="10" selection="#{mensagensBean.selectedMsgsGrupo}"&gt;
  
      &lt;p:column selectionMode="multiple" style="width:2%"/&gt;
  
      &lt;p:column headerText="Titulo:" style="width:49%"&gt;  
          #{msg.titulo}  
      &lt;/p:column&gt;
  
      &lt;f:facet name="footer"&gt;
          &lt;p:commandButton id="multiViewButton" value="#{msgs.delete}" icon="ui-icon-trash" actionListener="#{mensagensBean.excluirMsgsGrupo}" update=":tabMain" ajax="true"/&gt;
      &lt;/f:facet&gt;
  
  &lt;/p:dataTable&gt;
  </code></pre>