title: GWT, how to fire event from widget or composite using EventBus from HandlerManager
body: <p>I have widget. I would like to fire an event as follow:</p>
  
  <p><code>fireEvent(new IndicatorStartEvent("Message"));</code></p>
  
  <p>But it dosn't work.</p>
  
  <p>Normally I use Presenter for this (GWTP), but now I just would like to have regular widget:</p>
  
  <pre><code>public class FileUploadWidget extends Composite {
      MaterialFileUploader uploader = new MaterialFileUploader();
  
      @Inject
      public FileUploadWidget(String triggerId, EventBus eventBus) {
          super();
          initWidget(uploader);
          Window.alert("TEST Start");
          fireEvent(new IndicatorStartEvent("Message"));
      }
  }
  </code></pre>
  
  <p>Here is event code:</p>
  
  <pre><code>public class IndicatorStartEvent extends GwtEvent&lt;IndicatorStartEvent.IndicatorHandler&gt; {
      public static Type&lt;IndicatorHandler&gt; TYPE = new Type&lt;IndicatorHandler&gt;();
  
      public interface IndicatorHandler extends EventHandler {
          void onIndicatorProgressStart(IndicatorStartEvent event);    
      }
  
      public interface IndicatorHandlers extends HasHandlers {
          HandlerRegistration addStartIndicatorHandler(IndicatorHandler handler);
      }
  
  
      private final String message;
  
      public IndicatorStartEvent(final String message) {
          this.message = message;
      }
  
      public static Type&lt;IndicatorHandler&gt; getType() {
          return TYPE;
      }
  
      @Override
      protected void dispatch(final IndicatorHandler handler) {
          handler.onIndicatorProgressStart(this);
      }
  
      @Override
      public Type&lt;IndicatorHandler&gt; getAssociatedType() {
          return TYPE;
      }
  
      public String getMessage() {
          return this.message;
      }    
  }
  </code></pre>
  
  <p>This is my app presenter that handle the event:</p>
  
  <pre><code>public class AppPresenter extends TabContainerPresenter&lt;AppPresenter.MyView, AppPresenter.MyProxy&gt; implements AppUiHandlers
  , IndicatorStartEvent.IndicatorHandler {
      @ProxyStandard
      public interface MyProxy extends Proxy&lt;AppPresenter&gt; {}
      public interface MyView extends TabView, HasUiHandlers&lt;AppUiHandlers&gt; {}
      @Override
      protected void onBind() {
          super.onBind();
          addRegisteredHandler(IndicatorStartEvent.getType(), this);
      }
  
      public void onAsyncCallFail(AsyncCallFailEvent event) {
      // fireEvent is executed from: com.gwtplatform.mvp.client;PresenterWidget
          fireEvent(new IndicatorStartEvent("Firing message"));
      }
  
      @Override
      public void onIndicatorProgressStart(IndicatorStartEvent event) {
          MaterialToast.fireToast("Indicator start: " + event.getMessage());
      }
  }
  </code></pre>
  
  <p>If I fire this event from f.e.: <code>AppPresenter</code> (code above), or GwtRESTY filter/callback ass follow:</p>
  
  <pre><code>class ProgressIndicatorFilter implements DispatcherFilter {
      private AssistedInjectionFactory factory;
      private EventBus eventBus;
  
      @Inject
      public ProgressIndicatorFilter(AssistedInjectionFactory factory, EventBus eventBus) {
          this.factory = factory;
          this.eventBus = eventBus;
      }
      @Override
      public boolean filter(Method method, RequestBuilder builder) {
          builder.setCallback(factory.createProgressIndicatorCallback(method));
          eventBus.fireEvent(new IndicatorStartEvent("Rest-Gwt Comunication started"));
          return true;
      }
  }
  </code></pre>
  
  <p>It work as expected. But in those working examples it use <code>com.google.web.bindery.event.shared;EventBus</code>
  The firing event doesnt work from widget, where is used:
  <code>com.google.gwt.event.shared;HandlerManager;Bus</code> class. This class <code>Bus</code> extends <code>com.google.web.bindery.event.shared.SimpleEventBus</code> which extends the proper <code>EventBus</code> class from <code>com.google.web.bindery.event.shared;EventBus</code>.</p>
  
  <p>So the widget's method fireEvent() use other <code>EventBus</code>. </p>
  
  <p>Can anyone help me with this?</p>
  
  <p>I've red official and this instruction:
  <a href="http://blog.arcbees.com/2015/04/01/gwt-platform-event-best-practices-revisited/" rel="nofollow">http://blog.arcbees.com/2015/04/01/gwt-platform-event-best-practices-revisited/</a>  but no luck so far. Please help.</p>