Table does not resize to fit window size after resizing any column

Hi All,

Is this a normal behaviour of table component?

Before resizing any column, table lays out well when resizing the browser window, but after changing it’s one of column size (through dragging), it does not layout anymore.
Instead it shows a horizontal scroll bar.

thanks in advance,

Window mainWindow = new Window("Ikarustable Application");
		VerticalLayout layout = new VerticalLayout();
	        Table tabl1 = new Table();

		// selectable


This is in fact how it is supposed to work. It worked more the way that you would expect before 6.4 or 6.5 but then the behaviour was changed. When you render the table initially, all columns have a default dynamic width, for example “take one seventh of the whole table width”. What was changed in table was that the instant that you resize one column, all the columns measures their current width and sets that pixel amount as their static width, instead of using the dynamic width. The reason this was changed is that resizing multiple columns to the right size became somewhat impossible, because every column resize made by the user triggered an automatic resize of all the other columns of the table. That meant if you wanted to columns to have a specific width, they would keep on resizing each others.

So yeah, that is the normal behaviour

The new behavior is still just plain funky, I do not like it at all. At least the last column should span to the end of the available space if the sum of column widths is less than the table width. I think this should be somehow controllable even further than the current pixel widths + expand ratios.

For instance, you could be allowed to specify if the columns are allowed to overflow horizontally or not (i.e. always fit the columns in the visible space). Some columns should be allowed to be fixed, so the user can’t resize them.

Even if the new behavior might not match everybody’s needs (clearly), I think it is better than the old one where everything kept on resizing themselves. The behavior matches many other similar tables, take for example Windows’ file explorer or Mac’s Finder.

Not saying that it is perfect, just better.

Mac’s Finder doesn’t have any expanding in the columns, they’re all fixed to the sizes you drag them. An alternative example from Mac is, which doesn’t allow the columns to overflow horizontally.

The old behavior was irritating, I agree. And the new behavior needs a bit more polish.

Yes. I agree, athough it is better than previous version, it still needs some refinement. there can be an option(flag) for rendering the columns to fit the visible area.

We just wanted to upgrade from Vaadin 6.5.4 to 6.6.6 and found this new behaviour really bad. We are sure our client will see this as a bug, not a feature! What was wrong with the old behaviour? It was really good that one could make a column wider and still when the layout was changed the columns grew or shrank propoptional to its previous size. Now after just one manual column resize, the table does not fit its size anymore!
Please make the old behaviour available again through a new table setting… Thanks!


[/s]Is this possible to switch off this behaviour in vaadin 6.7.6 ? It doesn’t match our expectations at all, disabling manual resizing is also troublesome.

the current behavior is not acceptable by clients.
If you resize a column the expand the panel to full screen you expect to see the table expanded

I also believe that the current behaviour is far from optimal.
How about the following behaviour as an option: You shift the borders between columns and do not simply increase/decrease the size of a single column. That is, you increase the size of a column to the right, the next column on the right-hand side shrinks. By default the width of the complete table remains unchanged. If resizing the whole table should be allowed, one could allow to shift the very right border of the table (configurable via an option).

Moreover, it would be great to disallow resizing for single columns. That’s makes the mechanism a bit more complicated, since resizing one column would mean to automatically resize the “closest” resizeable other column, which is not always the direct neighbour.

Comments welcome.