Class UiEventPublisher

java.lang.Object
io.jmix.flowui.UiEventPublisher

@Component("flowui_UiEventPublisher") public class UiEventPublisher extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    protected org.springframework.context.ApplicationContext
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    UiEventPublisher(org.springframework.context.ApplicationContext applicationContext)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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)