I am working on a project where I have to use primefaces datatable.It needs one list to populate the data.
The datatable code is posted below.
<p:dataTable var="refVariable" value="#{managedBean.listData}" rows="10">
<p:column>
.....
<p:column>
.....
</p:dataTable>
ManagedBean code
private List<Object> listData;
setter method
.........
gettter method
public List<Object> getListData()
{
listData = service.getDataValues();//call to core method to get the list of object values
return listData;
}
Whenever I do any operation ..I mean searching, sorting Call is always going to getter method where I have the actual logic to get the data. Suppose If I have 10 rows ...If I do any sort operation It is calling 10 times to my getter method.
How can I minimize the call to getter method
Any suggestions greately appreciated.
Thanks.