Package io.jmix.flowui
Class UiEventPublisher
java.lang.Object
io.jmix.flowui.UiEventPublisher
The class fires application events that should be handled in the components (e.g. Screen). To enable handling
application events in the
Screen
, annotate method with EventListener
. For instance:
@EventListener public void customUiEventHandler(CustomUiEvent event) { // handle event }To correctly update the UI, class that implements
AppShellConfigurator
should contain the Push
annotation. It can be spring boot application class:
@Push @SpringBootApplication public class MyDemoProjectApplication implements AppShellConfigurator { // configuration }Note that
Notification
uses current UI to show the notification. If application listeners use notifications,
current UI may display them all.-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
-
Constructor Summary
ConstructorDescriptionUiEventPublisher
(org.springframework.context.ApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
publish
(Collection<com.vaadin.flow.component.UI> uis, org.springframework.context.ApplicationEvent event) void
publishEvent
(org.springframework.context.ApplicationEvent event) Publishes event for all UIs in the current session.void
publishEventForCurrentUI
(org.springframework.context.ApplicationEvent event) Publishes event only for the current UI.
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Constructor Details
-
UiEventPublisher
@Autowired public UiEventPublisher(org.springframework.context.ApplicationContext applicationContext)
-
-
Method Details
-
publishEventForCurrentUI
public void publishEventForCurrentUI(org.springframework.context.ApplicationEvent event) Publishes event only for the current UI.- Parameters:
event
- application event
-
publishEvent
public void publishEvent(org.springframework.context.ApplicationEvent event) Publishes event for all UIs in the current session.- Parameters:
event
- application event
-
publish
protected void publish(Collection<com.vaadin.flow.component.UI> uis, org.springframework.context.ApplicationEvent event)
-