On Mon, Aug 10, 2009 at 2:23 PM, Stefan<[email protected]> wrote: > > Hi David, > > thank you for sharing your solution. I had hoped that there is another > possibility. I have two questions about your solution: > > 1. How would you load a sub application without using an iframe? > Wouldn't there be a clash between the main application and the sub > application because the JavaScript of both parts would reside in the > same window object?
When I was talking about running without an IFrame I meant that my application would not use an IFrame for display purpose. GWT still uses an IFrame to load and separate the actual application code. At a certain point my main application creates a DIV tag in the root page and gives the ID to the subapplication to render in the DIV tag. > 2. Can you please give me some more information about how you enabled > the communication between the applications. I can imagine a global > JavaScript object that registers and informs listeners of application > events. Yes indeed, that is basically what I've done. First of all, the main application put a JS object on the DIV block which the application will detect when starting. When the application is ready it calls a method on this JS object to notify the main application that it is ready. This way I can setup 2 way communication. So the application can listen to events from the main app and the main app can also get events from the sub apps. The API between these 2 application is very limited. I actually use JSON to encode/decode the messages since the Java->JS compiler obfuscates the actual objects. David --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
