public void setColumnIndexVar(String columnIndexVar) {
this.columnIndexVar = columnIndexVar;
}
protected void updateSortingFromBindings() {
TableDataModel model = getModel();
model.startUpdate();
try {
FacesContext facesContext = getFacesContext();
ValueExpression sortAscendingExpression = getValueExpression("sortAscending");
ELContext elContext = facesContext.getELContext();
if (sortAscendingExpression != null) {
Object sortAscendingObj = sortAscendingExpression.getValue(elContext);
if (!(sortAscendingObj instanceof Boolean))
throw new IllegalArgumentException("Illegal value returned from the 'sortAscending' attribute binding of DataTable orTreeTable with client-id (" + getClientId(facesContext) + "). " +
"It should be an instance of java.lang.Boolean, but was: " + (sortAscendingObj != null ? sortAscendingObj.getClass().getName() : "null"));
boolean newSortAscending = (Boolean) sortAscendingObj;
if (isSortAscending() != newSortAscending)
setSortAscending(newSortAscending);
}
ValueExpression sortColumnIdExpression = getValueExpression("sortColumnId");
if (sortColumnIdExpression != null) {
Object sortColumnIdObj = sortColumnIdExpression.getValue(elContext);
if (sortColumnIdObj != null && !(sortColumnIdObj instanceof String))
throw new IllegalArgumentException("Illegal value returned from the 'sortColumnId' attribute binding of DataTable or TreeTable with client-id (" + getClientId(facesContext) + "). " +
"It should be an instance of java.lang.String, but was: " + sortColumnIdObj.getClass().getName());
String newSortColumnId = (String) sortColumnIdObj;
String oldSortColumnId = getSortColumnId();
if (((newSortColumnId == null) != (oldSortColumnId == null)) ||
(newSortColumnId != null && !newSortColumnId.equals(oldSortColumnId)))
setSortColumnId(newSortColumnId);
}
} finally {
model.endUpdate();
}
}