Remove Button on Edit Screen


I’m using Cuba Platform v7 and I’m trying to add a Remove Button (to remove currently edit entity) directly from the Edit Screen.
There is no problem to create the button, but I don’t know how to do the operation by code.

In the previous version there was removeItem() method, but now?

Thank You


You can use the DataManager bean, e.g.:

private DataManager dataManager;

private void onRemoveBtnClick(Button.ClickEvent event) {
    if (!PersistenceHelper.isNew(getEditedEntity())) {
        // It's better to provide own action Id 
        // in order to handle remove in a browser screen 
        close(new StandardCloseAction("remove"));


1 Like

Hi Gleb,

I tried your solution and the entity is deleted but the browse table did not reload automatically. Can you help?

Thank you.