Class View.AfterCloseEvent

java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<View<?>>
io.jmix.flowui.view.View.AfterCloseEvent
All Implemented Interfaces:
Serializable
Enclosing class:
View<T extends com.vaadin.flow.component.Component>

public static class View.AfterCloseEvent extends com.vaadin.flow.component.ComponentEvent<View<?>>
The second (after View.BeforeCloseEvent) event in the view closing process.

In this event listener, you can show notifications or dialogs after closing the view, for example:

     @Subscribe
     protected void onAfterClose(AfterCloseEvent event) {
         notifications.show("Just closed");
     }
 

Note the event can be triggered few times for one View instance. It may happen if the user tries to navigate to the same View, which is currently opened. In this case, View.AfterCloseEvent is triggered, because we "close" the View, however due to navigation the same instance of View will be opened. It means View.AfterCloseEvent will be triggered again for the same View instance, when user close the View or navigates to another one.

See Also: