Observable Vaadin events
The add-on publishes many Vaadin events to CDI. You don’t have to register a listener, just use an observer to handle these:
-
ServiceInitEventSee VaadinServiceInitListener for details. -
PollEvent -
BeforeEnterEvent -
BeforeLeaveEvent -
AfterNavigationEventSee Navigation Lifecycle for details about navigation events. -
UIInitEventSee UIInitListener for details. -
SessionInitEvent -
SessionDestroyEvent -
ServiceDestroyEventWarningDuring application shutdown it is implementation specific, whether ServiceDestroyEventworks with CDI or not.
An example of a bootstrap page customizer:
Source code
Java
public class BootstrapCustomizer {
private void onServiceInit(@Observes ServiceInitEvent serviceInitEvent) {
serviceInitEvent.addBootstrapListener(this::modifyBootstrapPage);
}
private void modifyBootstrapPage(BootstrapPageResponse response) {
response.getDocument().body().append(
"<p>By CDI add-on</p>");
}
}