title: PrimeFaces Datatable: How to receive selected rows values?
body: <p>I use Prime Faces 6.2 to make a data table with checked column:</p>
  <pre><code>&lt;p:dataTable id=&quot;#{prefix}List&quot;
                   value=&quot;#{tickets}&quot;
                   lazy=&quot;true&quot;
                   paginator=&quot;true&quot;
                   paginatorTemplate=&quot;{FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}&quot;
                   currentPageReportTemplate=&quot;{startRecord}-{endRecord} из {totalRecords}&quot;
                   rows=&quot;20&quot;
                   rowKey=&quot;#{ticket.id}&quot;
                   var=&quot;ticket&quot;
                   emptyMessage=&quot;Записи в данной категории отсутствуют&quot;&gt;
  
      &lt;p:ajax event=&quot;toggleSelect&quot; listener=&quot;#{ticketForm.onAllSelect}&quot; process=&quot;@this&quot; partialSubmit=&quot;true&quot; /&gt;
      &lt;p:ajax event=&quot;rowSelectCheckbox&quot; listener=&quot;#{ticketForm.onSelect}&quot; update=&quot;:protocolForm&quot; /&gt;
      &lt;p:ajax event=&quot;rowUnselectCheckbox&quot; listener=&quot;#{ticketForm.onUnselect}&quot; update=&quot;:protocolForm&quot; /&gt;
      &lt;p:ajax event=&quot;rowSelect&quot; listener=&quot;#{ticketForm.onSelect}&quot; update=&quot;:protocolForm&quot; /&gt;
      &lt;p:ajax event=&quot;rowUnselect&quot; listener=&quot;#{ticketForm.onUnselect}&quot; update=&quot;:protocolForm&quot; /&gt;
       
      &lt;p:column selectionMode=&quot;multiple&quot; style=&quot;width:40px; text-align:center&quot; /&gt;
      
  </code></pre>
  <p>More specifically, when a header checkbox is selected I want to receive all selected rows data on server-side and use IDs of each row. Also, there's logic that helps to resolve a goal of hidding/rendering a page button when at least one checkbox is selected.</p>
  <p>For this purpose I need manualy intercept a row/checkbox selection event and record IDs from it when a button pushed, so I can't use <code>selection</code> attribute of dataTable using such logic.</p>
  <p>On server-side I have several event-listeners:</p>
  <pre><code>private Set&lt;AbstractMTSBUExportTicket&gt; abstractMTSBUExportTickets = new HashSet&lt;&gt;();
  
  public Set&lt;AbstractMTSBUExportTicket&gt; getAbstractMTSBUExportTickets() {
      return abstractMTSBUExportTickets;
  }
  
  public void onSelect(SelectEvent event) {
      abstractMTSBUExportTickets.add((AbstractMTSBUExportTicket) event.getObject());
  }
  
  public void onUnselect(UnselectEvent event) {
      abstractMTSBUExportTickets.remove(event.getObject());
  }
  
  public void onAllSelect(ToggleSelectEvent event) {
      // do smth
  }
  </code></pre>
  <p>Unfortunately, ToggleSelectEvent has only information about data-table itself within.</p>
  <p>None information about rows I couldn't find. Also I tried to add <code>process=&quot;@this&quot; partialSubmit=&quot;true&quot; </code> attributes but seems like they do different actions.</p>
  <p>So, could you give me an example of how it's possible to retrieve such data from an event object?
  Should I use another way to solve it? Thanks for your answers in advance.</p>