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.
Grid hidden + frozen columns reorder bug
Hello everybody,
I have a problem with the Grid with the combination of hidden and frozen columns and when column reordering is allowed.
The problem is that there are columns that should be frozen, but can be reordered.
For example: 10 columns, 2 hidden columns and 4 frozen columns. But now the first two visible columns are a bit buggy. They can be reordered by drag and drop, but dropped only from the third column. They are also not selectable (no blue border).
In my real project the editor is also not visible when opened through theses columns. But I could not reproduce that in the example. But maybe it has the same cause.
Someone has an idea how I can solve the problem? Is there a workaound?
The problem occous in the current version 7.7.4 and also in older version.
Here a little example to demonstrate the problem (as project in the attachment):
@Theme("mytheme")
public class MyUI extends UI {
/** Number of columns. */
private static final int COLUMN_COUNT = 10;
/** Number of hidden columns. */
private static final int HIDDEN_COLUMN_COUNT = 2;
/** Number of frozen columns. */
private static final int FROZEN_COLUMN_COUNT = 4;
/** Number of rows. */
private static final int ROW_COUNT = 10;
private Grid grid;
@Override
protected void init(VaadinRequest vaadinRequest) {
this.grid = new Grid();
this.grid.setWidth("100%");
this.grid.setSelectionMode(Grid.SelectionMode.NONE);
this.grid.setEditorEnabled(true);
this.grid.setColumnReorderingAllowed(true);
Grid.Column column;
for(int i = 0; i < COLUMN_COUNT; i++) {
column = this.grid.addColumn(i, String.class);
if(i < HIDDEN_COLUMN_COUNT) {
column.setHidden(true);
}
}
this.grid.setFrozenColumnCount(FROZEN_COLUMN_COUNT);
// Add headers
Grid.HeaderRow headerRow = this.grid.addHeaderRowAt(0);
Object[] frozenPropertyIds = new Object[FROZEN_COLUMN_COUNT];
for(int i = 0; i < FROZEN_COLUMN_COUNT; i++) {
frozenPropertyIds[i] = i;
}
HeaderCell headerCell = headerRow.join(frozenPropertyIds);
headerCell.setText("should be 'fixed'");
// Add rows to grid
Object itemId;
Item item;
Property property;
Container.Indexed datasource = this.grid.getContainerDataSource();
for(int i = 0; i < ROW_COUNT; i++) {
itemId = datasource.addItem();
item = datasource.getItem(itemId);
for(int j = 0; j < COLUMN_COUNT; j++) {
property = item.getItemProperty(j);
property.setValue("value " + i + "-" + j);
}
}
final VerticalLayout layout = new VerticalLayout();
layout.addComponent(this.grid);
layout.setMargin(true);
layout.setSpacing(true);
setContent(layout);
}
@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet {
}
}
Has anyone checked the problem? It is also in the new Vaadin Version 7.7.5.
I believe this was https://github.com/vaadin/framework/issues/8265, with a fix waiting to be released soon in 7.7.7.