Table myTable = new Table("Report list");
myTable.setSizeFull();
myTable.setPageLength(0);
myTable.setSelectable(true);
Normally no scrollbars are shown in this table. When i click a row in the table, scrollbars appear vertically AND horizontally. Strange, because no items are added to the table. Especially the horizontal scrollbar is VERY annoying, because it is painted over the last element in the table and if the table contains only 1 element you can’t select any item anymore.
It appears like selecting a row, triggers a vertical scrollbar (i don’t see why, because a selected row has the same height as a non-selected one) and then the columns are not resized, so because the vertical scrollbar is now in the way, a horizontal scrollbar is added…
Resizing the browser window, fixes the scrollbar-issue (=they disappear again because the columns ARE resized).
Can anybody please tell me what is going on here?
Again, this only appeared when switching to Vaadin 6.4…
This sounds like a bug that’s introduced after the keyboard navigation was added to the table. The focused row is indicated by borders, which I guess might overflow the total table area, resulting in scrollbars.
As a temporary workaround, you can disable the scrollbars entirely with CSS. Just specify a stylename for the table, and use the following CSS:
I’m currently trying to resolve all possible 6.4 regressions. How do you reproduce the issue? I didn’t see an issue. On what browser/platform? A small code snippet to build a problematic table?
Building a small project to reproduce the issue is bit of work, so for the moment i would like to postpone that. But what i can tell, that might help, is that i’m using the Chameleon Theme from the Directory. Maybe that’s why you can’t reproduce it?
I’ve tried the other solution and included the extra style to completely block the scrollbars and that did help, but it not really a solution, because sometime i really need horizontal scrollbars (if it doesn’t fit the table).
I just want that the columns/rows are resized once scrollbars are shown in a way i’m still able to see the last row, which is not the case right now, and gives a huge problem when there is only 1 element in the table.
I’ve been banging my head against the wall with IE7 and table scrollbars. Whenever I select row from table I get both vertical and horizontal scrollbar even though there is no need for them. Biggest problem is when I select row from table with a single row. I get horizontal scrollbar on top of the last row and it’s difficult to double-click it.
I added that css stuff you posted and the problem is gone, my table works now in both Firefox and IE
Yes, that worked for me but I came up with a solution where you don’t need that extra page length. All I needed was to set layout containing my table to full size.
Panel panel = new Panel();
panel.setSizeFull();
panel.setScrollable(false);
VerticalLayout layout = (VerticalLayout) panel.getContent();
layout.setMargin(false);
layout.setSpacing(false);
[b]
layout.setSizeFull(); //this does the magic!
[/b]
Table table = new Table(null, dataSource);
table.setSizeFull();
table.setPageLength(0);
panel.addComponent(table);
Actually before I added that layout.setSizeFull() my whole table was scrolling, headers included. Scrolling down meant that I couldn’t see table headers anymore. Layout size setting magically fixed my table scrolling so that now only table body scrolls which is the correct behavior.
I don’t know what’s your component hierarchy but that example is the way to make scrollbars work if your table is inside a panel.