I’m using vaadin 12.0.7 and having trouble with component renders.
I’ve found multiple examples but none of them work.
The column is rendered as is the heading but the cell is empty.
I’ve tried:
entityGrid.addColumn(new ComponentRenderer<>(ComboBox<String>::new, (comboBox, nodule) -> {
})).setHeader("ID");
// entityGrid.addColumn(new ButtonRenderer("HI"));
entityGrid.addColumn(new ComponentRenderer<>(person ->
{
// text field for entering a new name for the person
TextField name = new TextField("Name");
name.setValue(person.getGuid());
// button for saving the name to backend
Button update = new Button("Update", event ->
{
entityGrid.getDataProvider().refreshItem(person);
});
// button that removes the item
Button remove = new Button("Remove", event ->
{
});
// layouts for placing the text field on top of the buttons
HorizontalLayout buttons = new HorizontalLayout(update, remove);
return new VerticalLayout(name, buttons);
})).setHeader("Actions");
entityGrid.addColumn(new ComponentRenderer<>(item ->
{
Button editButton = new Button("Edit");
return editButton;
// return buildEditButton(item);
}))
.setHeader("Edit");
None of these techniques work.
Am I doing something wrong?
Does vaadin 12 actually have working renderers?
The doco seems to say so but after a couple of hours of trying every option I can find I’ve had no luck.