oh yes, I forgot to mention that innerframes behave like window and
have own javascript namespace so if you're using the default GWT
linker, which loads the application in innerframes and your hosted
page provides your sharedCodeBase.js file, then you should interop via
the top window which initially loaded the hosted page, you can reach
the top window via $wnd.top ( to get the parent of the innerframe you
can also do $wnd.parent )
//register moduleA as listener
$wnd.top.myBus.addListener("SOME_GLOBAL_EVENT", this)
//register moduleB as listener
$wnd.top.myBus.addListener("USER_LOGIN_EVENT", this)
//fire a LOGIN EVENT from moduleA and moduleB will get notified
$wnd.top.myBus.fire("USER_LOGIN_EVENT", this)
btw:
you have to operate on events described by STRINGs, so they sustain
the obfuscation, therefore you cannot use the HandlerManager class
from GWT as a bus, but rather write your own one, follow the Observer
pattern...watchout further you have to interop via JSON messages
rather than Java classes, remember any API is dead after obfuscation.
but I would really advise you to give a try the code splitting feature
also to minimize the code footprint, and I dont think that GWT is
optimized for this "binary" deployment model where you can compile
multiple stand-alone runnable modules and than just make them working
together without a new recompilation! of course there're workaround
like above, one can also implement message queue etc but I think you
better should raise a feature request to development team and maybe
they have (or gonna provide) a better solution, which also is
optimized for performance
On 19 Okt., 18:45, aditya sanas <
007aditya.b...@gmail.com> wrote:
> thanks for ur reply and kind help.
> i am still searching for the right solution.
> I have implemented what u have specified in the la st thread as -
> $wnd.myBus.fire("myModule","initState")
> this works fine when i m opening both the modules in different (seperate)
> windows of the same browser. but whenever i try this using inner frame it
> doesn't work as it should be.
>
> so for guiding purpose if you can share a code snippet that might help me
> for better understand.
>
> And yes,we had thought of code splitting but we couldn't implemented it.
>
> thanks.
> --
> Aditya
>
> > > > <
google-web-toolkit%2Bunsu...@googlegroups.com<
google-web-toolkit%252Buns...@googlegroups.com>
> > <
google-web-toolkit%252Buns...@googlegroups.com<
google-web-toolkit%25252Bun...@googlegroups.com>