How do I detect an afterCloseEvent when using screenBuilders.editor

I am editing an entity by clicking on a button in a screen using the following code:

screenBuilders.editor(Customer.class, this)

I would now like to run some code once the user closes the Editor window.
How do I do that ?
I noticed that there is no “afterCloseEvent”

In case you do not specify screen class you can add listener to the screen produced by build:

private ScreenBuilders screenBuilders;

private void openOtherScreen() {
    Screen screen = screenBuilders.editor(User.class, this)
    screen.addAfterCloseListener(e -> {

1 Like

Thank you Yuriy. It works - Exactly what I was looking for !