Class View.BeforeShowEvent
- All Implemented Interfaces:
Serializable
View.InitEvent
) event in the view opening process.
All components have completed their internal initialization procedures.
Data loaders have been triggered by the automatically configured DataLoadCoordinator
facet.
In this event listener, you can load data, check permissions and modify UI components. For example:
@Subscribe protected void onBeforeShow(BeforeShowEvent event) { customersDl.load(); }
You can abort the process of opening the view by throwing an exception.
Note consequent navigation to the same View
, which currently opened, leads to
triggering View.BeforeShowEvent
once more for the same View
instance. For example, the user
navigates to the View
first time: View
instance is created, View.BeforeShowEvent
is
triggered. Then the user navigates to the same View
, which currently opened: we have the same
View
instance, but View.BeforeShowEvent
is triggered again.
If View.BeforeShowEvent
method listener contains logic of adding components or loading data, it will be
performed again, which can lead to adding duplicated components or reloading data.
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
-
Method Summary
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
Methods inherited from class java.util.EventObject
toString
-
Constructor Details
-
BeforeShowEvent
-