public void loadLazyData() {
DataModel model = getDataModel();
if(model instanceof LazyDataModel) {
LazyDataModel lazyModel = (LazyDataModel) model;
lazyModel.setPageSize(getRows());
List<?> data = lazyModel.load(getFirst(), getRows(), resolveSortField(this.getValueExpression("sortBy")), convertSortOrder(), getFilters());
lazyModel.setWrappedData(data);
//Update paginator for callback
if(this.isPaginator()) {
RequestContext requestContext = RequestContext.getCurrentInstance();
if(requestContext != null) {
requestContext.addCallbackParam("totalRecords", lazyModel.getRowCount());
}
}
}
}