Package io.jmix.flowui
Class UiEventPublisher
java.lang.Object
io.jmix.flowui.UiEventPublisher
Sends application events that should be handled in the components (e.g. views). To enable handling
application events in the
View
, annotate a 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 the main Spring Boot application class:
@Push @SpringBootApplication public class MyDemoProjectApplication implements AppShellConfigurator { // configuration }
-
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)
-