Weird Bug with Grid

Using vaadin version: 7.4.2

Adding to a Grid container while toggling the visibility of items above it causes a weird client side exception that can only be detected by running the application in debug mode with the ?debug parameter. The result of the exception is that the first item in the container disappears and the first row seems to merge with the second.

Source Code:
Please excuse any typos. I had to type the source code by hand. [code]
public class TestGrid extends VerticalLayout implements View {
public TestGrid() {

    BeanItemContainer<TestBean> container = new BeanItemContainer<>(TestBean.class, createBeans(5));
   
    Button newButton = new Button("New");
    Button save = new Button("Save");
    TextField textField = new TextField("Name");

    Layout saveSection = new FormLayout(textField, save);
    saveSection.setVisible(false);
    addComponents(newButton, saveSection);

    newButton.addClickListener(e -> {
        saveSection.setVisible(true);
        newButton.setVisible(false);
    });

    save.addClickListener(e -> {
        container.addBean(new TestBean(textField.getValue()));
        saveSection.setVisible(false);
        newButton.setVisible(true);
    });

    Grid grid = new Grid(container);
    grid.getColumn("name").setHeaderCaption("Name");
    addComponent(grid);
}

private List<TestBean> createBeans(int count) {
    // Omitting for brevity. Returns an Array of beans with size = count.
}

// Omitting override for enter method.

public static class TestBean {
    String name;

    public TestBean(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }
}

}
[/code]

Hi there. Have you tested this with the newest Vaadin version ? Since 7.4.2 there has been a ton of Grid related bugs fixed, so if you can, please check if the issue is still present with the newest version 7.5.4.

I’ve upgraded to 7.5.5. I can confirm that the error referenced above still occurs for version 7.5.5. I have also found that there is another bug present that deals with resizing and scroll bars. And the bug appears to be different based on browser.

To reproduce:

  • Shrink the window size such that a scrollbar is visible for the Grid.
  • Move the scroll bar to the right.
  • Maximize the window.
  • Shrink the window again.

At this point, the bug varies by browser.

Chrome / Internet Explorer:

  • You can no longer scroll while minimized.

Firefox:

  • When you maximize the scroll position doesn’t reset so the contents on the left side of the grid are no longer visible.
  • When you minimize, you can still scroll, but to fix the maximize you have to scroll all the way to the left, before maximizing.