How to tell when a Notification / monolog has been closed


Say I need a monolog notification which displays “Please insert a floppy disk and press ok to continue”. My code would need to know when the ok button had been pressed. Old example, I know :wink:

In Vaadin, the closure of Notification boxes seems to be entirely client-side and I can’t tell when it has been closed. I need to stop server-side processing until the user has taken the action displayed in the error Notification and clicked it to close.

Any suggestion?

Vaadin windows send events to server-side. You can listen to
Window close
in addition to “Ok” button click.

As I understand Window.Notification is not a Window. I displayed Notification in Main window and call getWindows() method - it returns only one Main window in spite of notification wad displayed. So I can’t add a CloseListener for notification.

Perhaps the
demo is what you look for.

This demo is about closing windows. But notification is not a window and I can’t add CloseListener to notification component.

As mentioned in other threads, the server will completely forget everything about a Notification after telling the client to show it, and there is no message from the client to the server when a Notification is closed - there are no close events for notifications.

You would need to modify the client-side implementation and find a suitable channel for communicating back to the server to implement this. I found an old enhancement request for implementing a click listener for notifications (
), but apparently nobody has created a ticket for implementing a generic notification close listener.

Thank you!