So I have a DataGrid that displays comments on an object, stored as a String, but only when certain conditions are met, so the column that displays the comments is generated like this:
DataGrid.Column commentColumn = wellsGrid.addGeneratedColumn("wellComment", new DataGrid.ColumnGenerator<Well, String>() {
@Override
public String getValue(DataGrid.ColumnGeneratorEvent<Well> event) {
return event.getItem().getWComment();
}
@Override
public Class<String> getType() {
return String.class;
}
});
commentColumn.setCaption("Comment");
However, I was unable to edit the column, even when explicitly calling setEditable(true), so I thought maybe a field generator would work, so I applied this to the column:
commentColumn.setEditorFieldGenerator((datasource, property) -> {
TextField textField = componentsFactory.createComponent(TextField.class);
textField.setDatasource(datasource,property);
return textField;
});
but that didn’t work either. Am I doing something massively wrong?
Thank you for your time.