drtman
unread,Oct 2, 2011, 6:39:58 PM10/2/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
I am not an expert in Javascript. However, I need to make a callback
into my GWT app from a <script> tag in an HTML page that is
dynamically loaded into an iframe (GWT Frame). In a nutshell, I have
the native function, and the export of that function working on the
client side, and I can see the variables defined in the DOM tab in
Firebug. However, I am not sure what the JS code inside the <script></
script> tag should look like. Can't I just do something like this:
<script language="javascript">$wnd.myFunc()</script>
or...
<script language="javascript">window.myFunc()</script>
??
Either one of those gives errors that "myFunc" is not defined
(ReferenceError). I am not sure if I am doing the call within the
<script></script> tag incorrectly, or if there is some problem with
the fact that this is happening inside of an iframe that is
dynamically loaded after the initial page (even though they originate
from the same domain)?
This is the export of the function that happens earlier in the app
(before the HTML with the script call is downloaded into an iframe),
and I am pretty sure this is all working correctly.
public static void myFunc()
{
// does some stuff
}
public static native void exportMyFunc()
/*-{
$wnd.myFunc = $entry(@myPackage.MyClass::myFunc());
}-*/;
Any ideas?