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:
ServiceInitEvent
See VaadinServiceInitListener for details.PollEvent
BeforeEnterEvent
BeforeLeaveEvent
AfterNavigationEvent
See Navigation Lifecycle for details about navigation events.UIInitEvent
See UIInitListener for details.SessionInitEvent
SessionDestroyEvent
ServiceDestroyEvent
WarningDuring application shutdown it is implementation specific, whether ServiceDestroyEvent
works with CDI or not.
An example of a bootstrap page customizer:
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>");
}
}