CASCADE Delete removes the related entites only after refreshing the TreeTable on Cuba 7

Hi,
I have a entity with parent field and children field, parent fields has UNLINK on delete and children field has CASCADE on delete… While removing the entity instance, the related entities in the treetable (i.e., the child instances) are deleted but showing in the treetable, it is removed from the table only after refreshing the TreeTable…

Hi,
You should refresh the table data after removing the entity. In order to do it, override the default handler of the “Remove” action as follows:

@UiController("sales_Order.browse")
@UiDescriptor("order-browse.xml")
@LookupComponent("ordersTable")
@LoadDataBeforeShow
public class OrderBrowse extends StandardLookup<Order> {

    @Inject
    private RemoveOperation removeOperation;
    @Inject
    private GroupTable<Order> ordersTable;
    @Inject
    private CollectionLoader<Order> ordersDl;

    @Subscribe("ordersTable.remove")
    private void onOrdersTableRemove(Action.ActionPerformedEvent event) {
        removeOperation.builder(ordersTable)
                .withConfirmation(true)
                .afterActionPerformed(e -> ordersDl.load())
                .remove();
    }
}