Search code examples
eclipse-scout

Summary row in table, SumTableControl


In table field, in bottom left corner there is search icon, also there is option for aggregation icon (saw in Eclipse Scout Demo)..But how to add that control to table, and make it visible from start.

I have some columns in table that I need to sumarize.


Solution

  • The icons you see in the table footer are a concept called 'table controls'. You can simply activate the aggregation table control like this:

    public class MyTable extends AbstractTable {
    
        @Override
        protected List<Class<? extends ITableControl>> getConfiguredTableControls() {
            return Collections.singletonList(AggregateTableControl.class);
        }
    
        @Override
        protected void execInitTable() {
            getTableControl(AggregateTableControl.class).setSelected(true);
        }
    }