I have an Entity
public class Institute extends AbstractEntity {
@NotNull(message = "Domain required")
@NotBlank(message = "Domain required")
private String domain;
@NotNull(message = "Display name required")
@NotBlank(message = "Display name required")
@Size.List({
@Size(min = 5, message = "Min {min} characters"),
@Size(max = 60, message = "Max {max} characters")
})
private String displayName;
private boolean activeLicense = true;
}
Now my business logic dictates, the activeLicense should never be modified for certain institutes
I am aware, I can disable/hide fields on the editor, using the setVisibleProperties and setDisabledProperties from the FormFactory
I already have a selection listener on the grid to disable the delete button on some other business logic
grid.asSingleSelect().addValueChangeListener(event -> {
var institute = event.getValue();
if (institute == null) {
crud.getDeleteButton().setEnabled(false);
} else {
boolean shouldDisableDelete = //Some business logic
crud.getDeleteButton().setEnabled(shouldDisableDelete);
}
});
I just can't figure out how to link the grid selection, to disabling/hiding the checkbox in the editor.
Any pointers to set me off on the right direction will be most appreciated.
Thank you!
I have an Entity
Now my business logic dictates, the
activeLicenseshould never be modified for certain institutesI am aware, I can disable/hide fields on the editor, using the
setVisiblePropertiesandsetDisabledPropertiesfrom the FormFactoryI already have a selection listener on the grid to disable the delete button on some other business logic
I just can't figure out how to link the grid selection, to disabling/hiding the checkbox in the editor.
Any pointers to set me off on the right direction will be most appreciated.
Thank you!