Vaadin 8 Grid - client side exception

Hi,

I wanted to create Grid with dynamic columns (number of columns depends on how many function in db will return). So for example when db returns 5 columns, then Grid should have 5 columns. So facade returns data as:
Collection<Map<String, Object>> (String stands for column name, Object - any type returned by db). Now I created Grid, which works until I try to delete columns. Whenever I invoke com.vaadin.ui.Grid#removeAllColumns and addColumns again there is exception on client side (web browser):

Error rendering cell in column 1
com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'qh' of undefined

When columns are removed, information is send to client, and then grid is recreated everything is ok.

Below is simple Code which shows problem:

[code]
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.*;

import java.util.Collection;
import java.util.List;
import java.util.Map;

@Theme(“”)
@Widgetset(“”)
public class ExampleUI extends UI {

@Override
protected void init(VaadinRequest request) {
    ExampleGrid grid = new ExampleGrid();

    Button button = new Button("Refresh", l -> grid.createTable(getExampleData(), false));
    Button buttonDel = new Button("Del columns and refresh", l -> grid.createTable(getExampleData(), true));
    Button del = new Button("Remove columns", l -> grid.removeAllColumns());

    VerticalLayout layout = new VerticalLayout(new HorizontalLayout(button, buttonDel, del), grid);

    layout.setSizeFull();

    setContent(layout);
}

private List<Map<String, Object>> getExampleData() {
    return ImmutableList.<Map<String, Object>>builder()
            .add(
                    ImmutableMap.<String, Object>builder()
                            .put("key1", "value1")
                            .build()
            ).build();
}

class ExampleGrid extends Grid<Map<String, Object>> {

    public void createTable(Collection<Map<String, Object>> items, boolean removeColumns) {
        if (removeColumns) {
            removeAllColumns();
        }

        items.stream().findAny().ifPresent(item -> item.forEach(
                (key, value) -> addColumn(map -> "any value").setCaption("caption")
        ));

        setItems(items);
    }
}

}
[/code]Clicking on button “buttonDel” will cause exception throw on client side. Visible when ?debug in url address exists or in console when site is inspected.

Clicking on “del” and then “button” and everything is ok.

Vaadin version: 8.0.3
Chrome version: 56.0.2924.87 (64-bit)