Reputation: 249
Inside a for loop I use:
Grid.Column<Record> nameColumn = new Label(value);
grid.addComponentColumn(item -> nameColumn).setHeader(strSelectColumnNames[c]);
TextField firstNameField = new TextField();
nameColumn.setEditorComponent(firstNameField);
but the first line is not correct. I need nameColumn
in order to set the editor component.
How can I change the new Label(value)
?
Thank you
Upvotes: 0
Views: 1340
Reputation: 1370
You should return a different component instance for each row.
grid.addComponentColumn(item -> new Label(value));
Usage example: https://vaadin.com/components/vaadin-grid/java-examples/using-components
Upvotes: 4