I was trying to add seperate button in each row in datagrid to open the edit screen. Using the following code. But its showing like the last screenshot
private void openEditScreen() {
DataGrid.ButtonRenderer<StdRowPlan> gridButtonRendererFirstNameRenderer =
getApplicationContext().getBean(DataGrid.ButtonRenderer.class);
gridButtonRendererFirstNameRenderer.setRendererClickListener(
clickableRendererClickEvent -> onEditStdRowPlanClick(clickableRendererClickEvent.getItem()));
stdRowplansDataGrid.getColumn("editField").setColumnGenerator(row -> {
Label label = uiComponents.create(Label.class);
label.setValue("Preview");
return label;
});
stdRowplansDataGrid.getColumn("editField").setCaption("EDIT");
stdRowplansDataGrid.getColumn("editField").setRenderer(gridButtonRendererFirstNameRenderer);
}
and in the onEditStdRowPlanClick method
private void onEditStdRowPlanClick(StdRowPlan stdRowPlan) {
screenBuilders.editor(StdRowPlan.class, this)
.editEntity(stdRowPlan)
.build()
.show();
}
and xml
But in UI its shows like [object object]
Any solutions