title: Primefaces get all data in lazy model
body: <p>I am using lazy model for datatable in Primefaces. For exporting I want to get all data, by that I mean the data that is used for counting rows.</p>
  
  <p>I can get all data that is shown currently on datatable page by using:</p>
  
  <pre><code>List&lt;Info&gt; data = (List&lt;Info&gt;) lazyModel.getWrappedData();
  </code></pre>
  
  <p>but there may be more data on more pages. Is there any method similiar to just mentioned one to get all data from datatable? </p>
  
  <p>I've tried using this, but this would always return null:</p>
  
  <pre><code>DataTable dataTable = (DataTable) FacesContext.getCurrentInstance().getViewRoot()
              .findComponent(":form:infoTable");
  List&lt;Info&gt; data = dataTable.getFilteredValue();
  </code></pre>
  
  <p>Another way I've tried is to just make nearly the same query I am making for counting rows, with difference being that I get list of objects, not number of rows, but for that I also need a filter. If this could be a solution, how do I get a filter that I am using for lazy loading?</p>
  
  <p>Generally, how could I solve this issue?</p>