We are using a “Search Result Table” component. On this component the user can sort the table by multiple column by clicking the header of a column. How can a user reset this custom sorting. The only way I found was to log out and log in again.
If you are using the typical search portlet patterns, the sorting is automatically reset to the default whenever a new search is executed from the searchbar portlet.
Or to programatically reset the sorting from java code you would have to get the table control and iterate through each of the columns and set the ordinal back to the default.
For example:
//get the search result control
DataTable dataTable = getActiveSearchResultsControl();
//iterate through each of the columns and clear the sort ordinals
for (Iterator it = dataTable.getChildren().iterator(); it.hasNext();) {
UIComponent child = (UIComponent)it.next();
if (child instanceof com.webmethods.caf.faces.component.table.IExtendedColumn) {
//set ordinal to 1 for primary sort column, or 0 for no sorting for the column
((com.webmethods.caf.faces.component.table.IExtendedColumn)child).setOrdinal(0);
}
}