Storing Properties of a Vaadin8 grid

I’m currently migrating an Application to Vaadin8. I hit a roadblock as I wanted to store/load the properties of grid columns (width, sortorder, hiden, columnorder). Before Vaadin8 every column had a propertyId, which could be used to identify the column.

With Vaadin 8 it seems that there are two cases.

  1. The grid was created using a bean. Than Column.getId() is the propertyName, which should work
  2. The column was added manually by providing a value Provider. Than Column.getId() is null and I can’t find any other identifier that i could us

The index of the column can’t be used because it depends on the column order. Even accessing Grid.columnKeys via reflection is not even really an option because the columnKeys seem to be auto generated based on the order the columns are added. So if the columns aren’t fixed they can have “random” columnKeys.

Is there any other way to uniquely identify a column?

Stupid me. I my case I can use the Column caption which is always been set.

But it would be nice to have some fixed identifier for Columns like before that doesn’t depend on the locale or is changed due to other reasons.