Footer for index column (RowHeaderMode.INDEX), possible?


I have a table with an extra column showing indexes:

table.setRowHeaderMode(RowHeaderMode.INDEX); Can I add a footer under the index column, showing the total row count?

I tried:

int rowCount = resultsList.size(); //my row count
table.setColumnFooter(null, String.valueOf(rowCount));

but it doesn’t work (no number is shown). Any ideas?

Kind regards,


Hello Jim,
you can try it by doing something like this:

int number=table.getContainerDataSource().size(); //getContainerDataSourse() returns the viewing data-source container. //.size() returns the number of visible items in the container; in your case - rows //then ou can try by adding footer as you have done before: table.setColumnFooter(null,String.valueOf(number)) Hopefully it will help : )

Anastasia hi,

Thanks for replying. The problem is that tha last line table.setColumnFooter(null,String.valueOf(number)) is not doing anything under the index column.

I think that the property corresponding to the index column is not “null”



Hello Jim,
you are right, it just can’t work:
It should be something like this:

// Have a table with a numeric column
Table table = new Table(“Custom Table Footer”);
table.addContainerProperty(“Name”, String.class, null);
table.addContainerProperty(“Died At Age”, Integer.class, null);

// Set the footers
table.setColumnFooter(“Name”, “Average”);
table.setColumnFooter(“Died At Age”, String.valueOf(avgAge))
[/code]So you have to specify column explicitly (by name, for example) as you have mentioned.
Here is the full example of setColumnFooter usage: