0

I have a Table in my project inside a Panel inside a VerticalLayout and I need to set table height to fit the context. If I set

table.setsizeFull() ;
table.setPageLength(0);

then table height is much smaller than necessary and there are vertical scrollbar.

I tried to do like this:

table.setPageLength(table.getItemIds().size() + 1);
table.requestRepaint();

but in this case there are a lot of space under the table. I tried to set setSizeFull() for all elements but this has no effect. When I tried this:

table.setPageLength(table.getItemIds().size());
table.requestRepaint();

effect was the same, as in first case (smaller height and vertical scrollbar). How can I set table heigth to fit context?

Kirill
  • 1,540
  • 4
  • 18
  • 41

1 Answers1

0

Fixed by this:

table.setWidth(100, UNITS_PERCENTAGE); 
table.setHeight(SIZE_UNDEFINED, 0);
table.setPageLength(0);
Kirill
  • 1,540
  • 4
  • 18
  • 41