SimpleEventBus not firing event after creation

2011-04-12 Thread Matthew Hill
   

 this.eventBus.addHandler(SomeEvent.TYPE, new SomeEventHandler() {

 @Override

 public void onSome(SomeEvent event) {

  Window.alert(Hi);

 }

 });

  this.eventBus.fireEvent(new SomeEvent());


Why doesn't this work? When I debug and step through this code, I see that 
the handlers list is empty when fireEvent is called.


How can I add the handler immediately, so that I can fire it straight after?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: SimpleEventBus not firing event after creation

2011-04-12 Thread Jeff Chimene
On Tue, Apr 12, 2011 at 3:43 PM, Matthew Hill matt2...@gmail.com wrote:

  this.eventBus.addHandler(SomeEvent.TYPE, new SomeEventHandler() {

  @Override

  public void onSome(SomeEvent event) {

   Window.alert(Hi);

  }

  });

   this.eventBus.fireEvent(new SomeEvent());


 Why doesn't this work? When I debug and step through this code, I see that
 the handlers list is empty when fireEvent is called.


 How can I add the handler immediately, so that I can fire it straight
 after?


What's the context of the code sample? For example, are you already in an
event context? The use of this. also raises flags.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.