title: Dynamically changing pagination rows value in jsf primefaces
body: <p>I have a situation where I need to persist the value of rows attribute in Datatable and need to change it from the Managed bean. I am currently using jsf 3.4.1.</p>
  
  <p>Consider the sample code below,</p>
  
  <pre><code>&lt;p:dataTable var="car" value="#{dtPaginatorView.cars}" rows="10"
                       paginator="true"
                       paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                       rowsPerPageTemplate="5,10,15"&gt;
  </code></pre>
  
  <p>and I want it to be like...</p>
  
  <pre><code> &lt;p:dataTable var="car" value="#{dtPaginatorView.cars}" rows="#{dtPaginatorView.rows}"
                       paginator="true"
                       paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                       rowsPerPageTemplate="5,10,15"&gt;
  </code></pre>
  
  <p>so that I can bind the "rows" value to Managed bean variable which I can change it depending on logical conditions. Is it also possible to track the currently selected "rowsPerPageTemplate" value.</p>
  
  <p>Any help into this is greatly appreciated.</p>