See the Showcase sample, especially CwDictionaryExample.java.
To access staticIframe from mainIframe: It is up how these frame are
organized.
If these two frames is in the main html page, you can use Javascript:
$wnd.top.frames['staticIframe']
However, in your case, you want to access Dictionary instead of JS
object. So I think there are two options:
1. javascript dictionary is in mainIframe too: Make life simple :)
2. Write JSNI to set dictionary to mainIframe, for example:
private native void setDictionay()/*-{
$wnd['myDict'] = $wnd.top.frames['staticIframe']['myDict'];
}-*/;
Put a method call in your onModuleLoad(), and you can use your
Dictionary as normal: Dictionary myDict = Dictionary.getDictionary
("myDict");
I haven't test it, but I believe it works.
Trung,
http://www.gdevelop.com/
On Jan 10, 7:45 pm, zimzalabim <[email protected]> wrote:
> Hi everyone! I have put my GWT application in an iframe called
> mainIframe. When the application-server starts I want to load the
> contents of some database tables into a javascript dictionary which I
> have put in a dedicated iframe, called staticIframe. My question is;
> How can I access the javascript contents of the staticIframe from the
> mainIframe using Java? I typically need this to get the appropriate
> text-constants for my widgets.
>
> All feedback is greatly appreciated!
>
> Thanks!
--
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.