Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Vaadin 8 + Grid + setFrozenColumnCount + setHidden
Version: 8.0.0.beta1
The functions Grid.setFrozenColumnCount, Column.setHidable and Column.setHidden do not work properly.
If you click on the Button 'Change Grid' in the following code, nothing happens (only the progress bar on the top is blinking):
Grid<Car> grid1 = new Grid<>();
Grid<Car> grid2 = new Grid<>();
List<Car> cars = new ArrayList<>();
cars.add(new Car("Car 1"));
cars.add(new Car("Car 2"));
cars.add(new Car("Car 3"));
CarDataProvider cdp = new CarDataProvider(cars);
grid1.setDataProvider(cdp);
grid2.setDataProvider(cdp);
Column<Car, String> col1 = grid1.addColumn(new ValueProvider<Car, String>() {
private static final long serialVersionUID = 1L;
@Override
public String apply(Car car) {
return car.getPlate();
}
});
Column<Car, String> col2 = grid2.addColumn(new ValueProvider<Car, String>() {
private static final long serialVersionUID = 1L;
@Override
public String apply(Car car) {
return car.getPlate();
}
});
col1.setCaption("Cars of grid1");
col2.setCaption("Cars of grid2");
grid1.setFrozenColumnCount(1); // breaks it
col1.setHidable(true); // breaks it if you hide col1 in the grid
col1.setHidden(true); // breaks it
Button toggleButton = new Button("Change Grid");
toggleButton.addClickListener(event -> {
if (grid1.getParent() == vl) {
vl.replaceComponent(grid1, grid2);
} else {
vl.replaceComponent(grid2, grid1);
}
});
Button helloButton = new Button("Hello");
helloButton.addClickListener(event -> Notification.show("Hello"));
vl.addComponent(toggleButton);
vl.addComponent(helloButton);
vl.addComponent(grid1);
Yeah, looks like a bug. I created an issue for it: https://github.com/vaadin/framework/issues/8329
Cheers.
The issue created is resolved and has milestone 8.0.2 assigned to it.
https://github.com/vaadin/framework/issues/8329
But the problem can still be reproduced with the released Vaadin 8.0.2 version. (using the provided sample project above)
Confirmed fix with released Vaadin version 8.0.3