0

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.

user1625988
  • 73
  • 2
  • 6
  • Have a look at [this question](http://stackoverflow.com/questions/19704580/how-to-avoid-unnecessary-fetching-of-data-from-database-in-jsf) – Aritz Oct 31 '13 at 11:31
  • Check this out http://stackoverflow.com/questions/2090033/why-jsf-calls-getters-multiple-times – mstzn Oct 31 '13 at 12:29

0 Answers0