Set Caption of a Column in a Grid

I use Vaadin 8.

How can i set the Colums-Caption of a Grid. I need it for Internatioanlization/Localization

My SourceCode is:

grid.addColumn(Person::getFirstName).setCaption("Firstname")

This works well.

But how can i change for Localization the name of the Caption of the ColumnGrid

grid.getColumn((Person::getFirstName).setCaption("Firstname in German");

This doesn’t work

You need to either

a) set an id to the column when you add it with .setId("columnid") and then you can get the column with grid.getColumn("columnid") and update the Caption there

b) store the Column object that is returned from grid.addColumn()... and use it to update the Caption.

-Olli

Thanks

You’re welcome!