title: Primefaces datatable pagination not working after an update
body: <p>I am designing an application where certain input feeds are entered via primefaces datatable. </p>
  
  <p><strong>Version Spec:</strong>
  PrimeFaces - 4.0
  JSF  - 2.1.6</p>
  
  <p><strong>Problem Faced:</strong>
  Pagination breaks after updating datatable. Looks like before an update event is triggered in datatable, pagination works perfectly. The list mapped to this datatable is under "View Scope".</p>
  
  <p>Please find my XHTML code for datatable below,</p>
  
  <pre><code>&lt;p:dataTable var="profile" value="#{manualNBean.manualNlist}"
                                      rows="10" paginator="true" paginatorPosition="bottom"
                                      rowIndexVar="rowIndex" lazy="true"
                                      paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                      rowsPerPageTemplate="10,50,100,200" id="statustab"&gt;
  
                                      &lt;p:column headerText="S.No"&gt;
                                          &lt;p:outputLabel value="#{rowIndex+1}" /&gt;
                                      &lt;/p:column&gt;
  
                                      &lt;p:column headerText="Profile ID"&gt;
                                          &lt;p:outputLabel value="#{profile.profileID}" /&gt;
                                      &lt;/p:column&gt;
  
                                      &lt;p:column headerText="Law Firm Name"&gt;
                                          &lt;p:outputLabel value="#{profile.lawFirmName}" /&gt;
                                      &lt;/p:column&gt;
  
                                      &lt;p:column headerText="First Name"&gt;
                                          &lt;p:outputLabel value="#{profile.firstName}" /&gt;
                                      &lt;/p:column&gt;
  
                                      &lt;p:column headerText="Second Name"&gt;
                                          &lt;p:outputLabel value="#{profile.secondName}" /&gt;
                                      &lt;/p:column&gt;
  
                                      &lt;p:column headerText="Full Name"&gt;
                                          &lt;p:outputLabel value="#{profile.fullName}" /&gt;
                                      &lt;/p:column&gt;
  
                                      &lt;p:column headerText="Profile Link"&gt;
                                          &lt;h:outputLink value="#{profile.profileLink}" target="_blank"&gt;#{profile.profileLink}&lt;/h:outputLink&gt;
                                      &lt;/p:column&gt;
                                      &lt;p:column headerText="PPTS N" id="editNCol"&gt;
                                          &lt;p:commandButton icon="ui-icon-pencil" process="@this"
                                              update="statustab" rendered="#{profile.editbuttonRender}"
                                              action="#{manualNBean.turnoffRender}"&gt;
                                              &lt;f:setPropertyActionListener value="#{profile}"
                                                  target="#{manualNBean.manualNDTO}" /&gt;
                                          &lt;/p:commandButton&gt;
                                          &lt;p:autoComplete id="manualN" minQueryLength="3"
                                              value="#{profile.manualN}"
                                              style="#{profile.autocompletebuttonRender}"
                                              completeMethod="#{manualNBean.autocompleteN}"&gt;
                                          &lt;/p:autoComplete&gt;                                           
                                      &lt;/p:column&gt;                                                                             
                                  &lt;/p:dataTable&gt;
  </code></pre>
  
  <p>Here, update action is performed in command button. Even after update action is performed, the lazy model still seem to be filled with records from database but I wonder why pagination breaks.</p>
  
  <p><strong>Note:</strong> By adding ajax="false" attribute to the button, page reloads and now the pagination seem to be working fine. However, this is not feasible and looking forward to control this with Ajax.</p>
  
  <p>Just to add another note, this datatable populates information from database only after a button click.</p>
  
  <p>Can anybody advise where I am going wrong?</p>