Class View.BeforeCloseEvent

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

public static class View.BeforeCloseEvent extends com.vaadin.flow.component.ComponentEvent<View<?>>
The first event in the view closing process. The view is still displayed and fully functional.

In this event listener, you can check any conditions and prevent closing using the preventClose() method of the event, for example:

     @Subscribe
     protected void onBeforeClose(BeforeCloseEvent event) {
         if (Strings.isNullOrEmpty(textField.getTypedValue())) {
             notifications.show("Input required");
             event.preventClose();
         }
     }
 
See Also:
  • Field Details

    • closeAction

      protected final CloseAction closeAction
    • closeResult

      protected OperationResult closeResult
    • closePrevented

      protected boolean closePrevented
  • Constructor Details

    • BeforeCloseEvent

      public BeforeCloseEvent(View<?> source, CloseAction closeAction)
  • Method Details