title: p:datatable lazy pagination: after click on paging "first" became equals to page size
body: <p>My JSF bean with lazy data model</p>
  
  <pre><code>private Integer pageSize = 15;
  
  private Integer first = 0;
  
  
  @PostConstruct
  public void init() {
      responseDataList = new ResponseDataList();
      responseDataList.setPageSize(pageSize);      
  }
  
  public class ResponseDataList extends LazyDataModel&lt;User&gt; {
  
      public int total = 0;
      public int dataSize = 0;
  
      @Override
      public List&lt;User&gt; load(int first, int pageSize, String sortField, SortOrder sortOrder, Map&lt;String, Object&gt; filters) {
          List&lt;User&gt; data = new ArrayList&lt;&gt;();
          try {
  
  
              total = userRestClient.getTotalCount().intValue();
  
  
              int count = (first + pageSize);
             data = userRestClient.findAllUsers(first, count).getUserList();
  
              dataSize = data.size();
  
  
          } catch (Exception es) {
  
          }
          return data;
      }
  
      @Override
      public User getRowData(String rowKey) {
          return null;
      }
  
      @Override
      public Object getRowKey(User object) {
          return object.getId();
      }
  
      @Override
      public int getRowCount() {
          return (int) total;
      }
  }
  </code></pre>
  
  <p>My data table:</p>
  
  <pre><code>        &lt;p:dataTable var="list" id="userTbl"
                               value="#{usersBean.responseDataList}"
                               paginator="true" rows="#{usersBean.pageSize}" first="#{usersBean.first}"  reflow="true" 
                               paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} 
                               {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}" 
                               lazy="true"  rowsPerPageTemplate="5,10,15"
                               &gt;                                    
  </code></pre>
  
  <p>When I click to pagination first time "first" is zero, the second time is 15. Whats why paging is crashed. total is the whole data count in database. </p>
  
  <p>I do not understand how is growing "first" and where is my mistake?</p>