I have a problem with resizing table that is added as component to FormLayout. Table resizes OK to bigger size, but when window is resized to smaller size, table is not.
Code to repate problem:
public class TestUI extends UI
{
@Override
protected void init(VaadinRequest request)
{
FormLayout view = new FormLayout();
view.setWidth("100%");
Table table = new Table();
table.setCaption("Table");
table.setWidth("100%");
view.addComponent(table);
setContent(view);
}
}
Steps:
-on start table width is OK
-resize to bigger window, table width is OK
-resize to smaller window, table is too big
If Table is added to some different layout, for example VerticalLayout it works.
I found similar problem for ComboBox. When used in FormLayout it resizes in both ways but when shrinking it is limited to some width (156px), below that width it does not resize anymore.
So for example if i have this code below. Textfield resizes right, but combobx does not resize correctly under some width. If i change both FormLayout to some other layout, for example VerticalLayout, it works.
public class TestUI extends UI
{
@Override
protected void init(VaadinRequest request)
{
HorizontalLayout mainlayout = new HorizontalLayout();
mainlayout.setWidth("100%");
setContent(mainlayout);
Label filler = new Label("foo");
filler.setWidth("100px");
mainlayout.addComponent(filler);
FormLayout view2 = new FormLayout();
view2.setWidth("100%");
mainlayout.addComponent(view2);
TextField text = new TextField();
text.setCaption("text");
text.setWidth("100%");
view2.addComponent(text);
FormLayout view1 = new FormLayout();
view1.setWidth("100%");
mainlayout.addComponent(view1);
ComboBox combo = new ComboBox();
combo.setCaption("combo");
combo.setWidth("100%");
view1.addComponent(combo);
}
}
I also getting same issue on CustomLayout:
When enlarge page size, the Table will auto expand to correct size, but when reduce the page width the table stay on the same size, which is out side of page view.