Table Column Sizing with generatedColumn and align right

Hello,

I noticed a visual bug on a table column

  • with a columnGenerator
  • with align = right

as shown in the following code snippet


table.addGeneratedColumn("name", new ColumnGenerator() {

	@Override
	public Component generateCell(final Table source, final Object itemId, final Object columnId) {
		return new Label("testartName");
	}
});
table.setColumnAlignment("name", Table.ALIGN_RIGHT);

When the column is initially rendered, it looks fine (see beforeResize.png).
When the column is resized, I’d expect the content to be still aligned on the right side of the column (resizedSmaller.png, resizedLarger.png). Instead, the content does not move at all. it just stays where it was. What am I doing wrong?

Thanks!

P.S.: this affects at least Safari 5.1, Firefox 5.0.1 and Opera 11.5 on OS X.
11812.png
11813.png
11814.png

It doesn’t look like you’re doing anything wrong to me. You might want to consider
submitting a bug report
.

I would say the problem here is that the width of a Label is 100% by default. Try to set the width of your label to undefined by saying:

label.setWidth(null);

-Henri

Created a ticket
http://dev.vaadin.com/ticket/7331
.

Workaround

label.setWidth(null) 

works.

Thanks so far!