Package io.jmix.flowui.view
Class View.InitEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<View<?>>
io.jmix.flowui.view.View.InitEvent
- All Implemented Interfaces:
Serializable
The first event in the view opening process.
The view and all its declaratively defined components are created, and dependency injection is completed. Some visual components are not fully initialized, for example buttons are not yet linked with actions.
In this event listener, you can create visual and data components, for example:
@Subscribe protected void onInit(InitEvent event) { Label label = uiComponents.create(Label.class); label.setText("Hello World"); getContent().add(label); }Note that the event is triggered only once after
View
creation. It means if the
navigation to View
performed at first time, event triggered. Then if navigation performed to the same
View
, which currently opened, second and more times event is not triggered because the View
instance has been already created.-
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
-
InitEvent
-