Advanced Form Layout broken.

Hello Vaadin Community,

I’m not entirely sure on this one again, but I think the following is a bug in the Form class. When a field is attached Form calls the attachField() method. This works pretty well for implementing very specific layouts. However: When you change the layout attachField() is not called again:



    public void setLayout(Layout newLayout) {

...
        // Move fields from previous layout
        if (layout != null) {
            final Object[] properties = propertyIds.toArray();
            for (int i = 0; i < properties.length; i++) {
...
                    newLayout.addComponent(f);
            }
        }
...
}

At least I would recommend calling attachField() there again. Of course the layout field of form should be set to the new value before, because otherwise there is no way of retrieving the new Layout in attachField().

What do you think?

Greetings
PeeR