Removing a Grid with component column causes Uncaught client side exception

Removing a Grid that has a component column seems to fail in 8.6.0.beta1 but not in 8.5.2.
Removing causes “Uncaught client side exception: Renderers can only be used with a Grid.”

Try the attached project, use ?debug and click the “remove grid” button.

The sample project uses vaadin-compatibility packages and runo because the project I’m working on still (unfortunately) uses them.

Is this a bug or should I do something differently with component columns in 8.6?

17312975.zip (44 KB)

Same problem exists with valo theme and without the compatibility packages. And the application can be as simple as:

    protected void init(VaadinRequest vaadinRequest) {
		VerticalLayout lo = new VerticalLayout();
		setContent(lo);
		Grid<String> g = new Grid<>();
		g.addComponentColumn(s -> new Label(s));
		g.setItems("item 1", "item 2");
		lo.addComponents(g, new Button("remove grid", e -> lo.removeComponent(g)));
	}

I added some lines to the test app:

		g.setVisible(false);
...
				new Button("remove grid items", e ->  g.setItems(Collections.emptyList())),
				new Button("disable grid", e -> g.setEnabled(false)),
				new Button("show grid", e -> g.setVisible(true)),
				new Button("hide grid", e -> g.setVisible(false)),
				new Button("remove grid column", e ->  g.removeColumn(col)),

The problem might not be in removing the grid, but removing or hiding the component column. If the grid was never visible, removing the column and removing the grid works. But if the grid was set visible, the client side exception occurs also when the grid is set invisible or the column is removed.

Hi,

does the issue also happen on 8.6.0.alpha2? That would help narrow it down.

-Olli

Yes, it does happen in alpha2, but not in alpha1.

Thanks for testing!

Seems to be fixed in 8.6.0.rc1.