title: Primefaces datatable multiple selection mode - lazy load fetch
body: <p>On datatable, I have enabled multiple selection checkbox.
  And there is submit button, on actionlistener, I'm getting duplicate records as selected items.</p>
  
  <p>For ex., On first page it is 5 records and total number of records are 10, then the first page records gets replicated twice and results in 10 records, which should be restricted to 5 records.</p>
  
  <p>Following is the code snippet:</p>
  
  <pre><code>&lt;p:dataTable id="sampleDataTable" var="_task" value="#{myBean.lazyModelTasks}"
               styleClass="dataTable" paginator="true" paginatorTemplate="{PageLinks}"
               paginatorPosition="bottom" rows="5" widgetVar="dataTab"             
               paginatorAlwaysVisible="true" rowIndexVar="rowIndex" 
               lazy="true"  selection="#{myBean.selectedItems}" 
               emptyMessage="No Search Results found !"&gt;  
  
      &lt;p:column selectionMode="multiple" style="width:15px;"&gt;  
          &lt;f:facet name="header"&gt; 
          &lt;h:outputText value="Sno" /&gt; 
          &lt;/f:facet&gt;
      &lt;/p:column&gt;
   &lt;/p:dataTable&gt; 
  
   &lt;p:commandButton id="submit" value="Select" update="#{rerenderid}"
    actionListener="#{myBean.addSelectedItems}" oncomplete="#{onlinkclick}"&gt;
    &lt;f:attribute name="selectedItems" value="#{myBean.selectedItems}"/&gt;
   &lt;/p:commandButton&gt;
  </code></pre>
  
  <p><strong>Managed Bean code:</strong></p>
  
  <pre><code> public void addExternalRecipients(ActionEvent event) { 
        //THIS GIVES ME 10 RECORDS, THOUGH THERE ARE ONLY 5 RECORDS AT THAT INSTANCE
        this.selectedItems = (Address[])   
                           event.getComponent().getAttributes().get("selectedItems"); 
     }
  </code></pre>