Set<BaseColumn> visibleAndGroupedColumns = new LinkedHashSet<BaseColumn>(tableStructure.getColumns());
List<GroupingRule> groupingRules = rowGrouping.getGroupingRules();
if (groupingRules != null)
for (GroupingRule groupingRule : groupingRules) {
String columnId = groupingRule.getColumnId();
BaseColumn column = table.getColumnById(columnId);
visibleAndGroupedColumns.add(column);
}
String tableClientId = table.getClientId(context);
List<String> activeColumnIds = new ArrayList<String>();
List<String> groupableColumnIds = new ArrayList<String>();
for (BaseColumn column : visibleAndGroupedColumns) {
Object headerContent = TableHeader.getHeaderOrFooterCellContent(column, true);
HeaderCell cell = new HeaderCell(column, headerContent, "div",
CellKind.COL_HEADER, true, HeaderCell.SortingToggleMode.AUTODETECT);
String columnId = column.getId();
activeColumnIds.add(columnId);
cell.setId(tableClientId + "::groupingHeaderCell:" + columnId);
cell.setTableStructure(tableStructure);
cell.render(context, null);
if (column.isColumnGroupable())
groupableColumnIds.add(columnId);
}
ScriptBuilder buf = new ScriptBuilder();