On Mon, Jan 17, 2011 at 10:49 AM, Hamlet D'Arcy <[email protected]> wrote: > I would like to share a client singleton across GWT modules. Is this > possible? If so, how? > > I have several modules that need to share an EventBus (SimpleEventBus) > instance. Creating a singleton in GWT Java code and having all modules > inherit from the common module did not work. Each of the root modules > has a different instance of the EventBus. > > I also tried using the replace-with and create() approach documented > in ClientFactory of GWT MVC and that did not work. Each module had > it's own instance. > > Ideas?
This only works if modules are inherited and compiled into one nochache.js file. If you have several webpages each inheriting a different nochache.js it will not work. On the other hand: If you inherit modules from each other it works. Cheers, Raphael > > Thanks in advance, > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
