Generally we can do sort on tables asc/desc order. Some times we need to reset the table. In that case use below code
- public void resetTableSort(RichTable tableComponent, String iteratorName)
- {
- BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
- DCIteratorBinding iter = (DCIteratorBinding) bindings.get(iteratorName);
- tableComponent.queueEvent(new SortEvent(tableComponent, new ArrayList<SortCriterion>()));
- Key currentRow = null;
- Row row = iter.getCurrentRow();
- if (row != null)
- {
- currentRow = row.getKey();
- }
- SortCriteria[] sc = new SortCriteria[0];
- iter.applySortCriteria(sc);
- iter.executeQuery();
- if (currentRow != null)
- {
- iter.setCurrentRowWithKey(currentRow.toStringFormat(true));
- }
- }
No comments:
Post a Comment