Monday, August 6, 2012

Re: OSGi Application nested submodule messaging

I guess I would publish a JS API in the parent core application via JSNI and then call the API methods from your submodule iFrame (via top.apiMethodName() ) when they have loaded and need to customize the header/footer. This would be your second solution but the other way around which avoids polling and makes the code in your submodule may look more obvious about whats happening.

Alternatively there is something called Window.postMessage() which allows you to post message events between pages of different domains.
Browser support: http://caniuse.com/#search=postmessage
Mini Example/Documentation: https://developer.mozilla.org/en-US/docs/DOM/window.postMessage

In combination with AutoBeans for serialization/deserialization Window.postMessage maybe also works well (if you dont need support for IE6/7) and you probably need to write less JSNI code.

-- J.

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

No comments:

Post a Comment