* method explicitly. Note that this method returns the proper value only after the DataTable is rendered for the
* first time.
*/
public void updateModel(boolean updateSortingFromBindings, boolean updatePageIndex, boolean readActualData) {
setRowsDecodingRequired(readActualData);
TableDataModel model = getModel();
model.startUpdate();
int incomingPageIndex = Integer.MIN_VALUE;
try {
if (updateSortingFromBindings) {
updateSortingFromBindings();
model.setSortingRules(getSortingRules());
RowGrouping rowGrouping = getRowGrouping();
if (rowGrouping != null)
model.setGroupingRules(rowGrouping.getGroupingRules());
}
if (getRowsDecodingRequired())
model.setWrappedData(getValueExpression());
else
model.setWrappedData(Collections.EMPTY_LIST);
model.setFilters(getActiveFilters());
model.setPageSize(getPageSize());
if (updatePageIndex) {
incomingPageIndex = getPageIndex();
model.setPageIndex(incomingPageIndex);
}
} finally {
model.endUpdate();
if (updatePageIndex && incomingPageIndex != Integer.MIN_VALUE) {
int newPageIndex = model.getPageIndex();
if (newPageIndex != incomingPageIndex) {
setPageIndex(newPageIndex);
}
}
}