Window Close Listener

I am trying to open a window from another window. When the new window closes I want the previous window to realize this and refresh a table. This is what I have so far but the table is not refreshing:

 Window window = openWindow("emailer", WindowManager.OpenType.THIS_TAB, params);
        window.addCloseListener((String actionId) -> {
            System.out.println("*********************The window has closed");
            invoicesDs.refresh();
            invoicesTable.repaint();
        });

The close listener is not printing “*********************The window has closed”. How do I get a correct listener working?

Nevermind. For some reason it is now working.

Not sure why … Weird.

Hello,

Is everything okay now?

Best regards,
Daniil.