Perhaps your command handler java code could update the sort column as well.
For example, invoke something like this:
/**
* Update the table sort details
* @param dataTable the table control to process
* @param sortByColumnId the id of the column to sort by
* @param sortAscending true for ascending sort order, false for descending
*/
protected void changeSortColumn(UIData dataTable, String sortByColumnId, boolean sortAscending) {
if (dataTable != null) {
//loop through all the columns and configure which one to sort by
for (Iterator<UIComponent> it = dataTable.getChildren().iterator(); it.hasNext();) {
UIComponent child = it.next();
if (child instanceof IExtendedColumn) {
//fix sort/order
if (StringTools.notEmpty(sortByColumnId)) {
if (child.getId() != null && child.getId().equals(sortByColumnId)) {
//this is the sort column, so set-up the sorting
((IExtendedColumn)child).setOrdinal(1);
((IExtendedColumn)child).setAscending(sortAscending);
} else {
//not sorting by this column, so clear the ordinal
((IExtendedColumn)child).setOrdinal(0);
}
}
}
}
}
}
#webMethods-BPMS#MWS-CAF-Task-Engine#webMethods