Hi, I am working on a gwt project and we are using eventbus for communicating events between widgets. I have 2 modules and when i raise an event in one module, the other module is unable to receive it. How can i solve this.Any help??
+1
A:
Are you sure you've passed the same EventBus
to both modules, and that both modules have subscribed to the event that you're publishing?
What EventBus
class are you using, anyway? One you wrote yourself, or one that's included in a GWT library?
Jason Hall
2010-07-06 15:17:33
hey, Thanks for the follow up :) I have totally 3 modules. Admin, Technician and a module called common which is inherited by both admin and Technician.EventBus is my custom singleton class extended from handler manager and is defined in the common module.I did not have any requirement for passing data between the modules till now
prabha
2010-07-07 04:46:04
A:
You are most likely using two different instances of EventBus in each of the modules.
Two possible reasons:
You have created two different instances (check the code for the occurrences of something like new HandlerManager(null) if you are using the supplied one, or similar).
You have a problem with passing the eventBus reference between modules; how are you passing data across these two modules?
igorbel
2010-07-06 22:20:28
I have totally 3 modules. Admin, Technician and a module called common which is inherited by both admin and Technician.EventBus is my custom singleton class extended from handler manager and is defined in the common module.I did not have any requirement for passing data between the modules till now :(
prabha
2010-07-07 04:44:48
So, where do you create the EventBus? In the common module?How do you obtain its instance in the Admin and Technician classes?Keep in mind that when you inherit a module, its onModuleLoad() method of the EntryPoint class is called.
igorbel
2010-07-09 12:59:44