Hi folks, I am trying to build a system where some non-GWT Javascript
code can register itself to be run when a certain event happens within
a GWT widget.  (I don't mean a browser event, I mean a business-logic
event)

What I've come up with is a List of JavaScriptObjects that are invoked
via JSNI by the Java code.  I export the "add" and "remove" methods
for this list using a JSNI method:

$wnd.addCallback = /*JSNI code to my Java function*/

This functions exactly as I expect, except that addCallback is not
available to my plain-Javascript code when the page loads, only after
the GWT widget is finished loading.  So any code on my page like this:

<SCRIPT TYPE=...>
addCallback(myFunction);
</SCRIPT>

says that "addCallback" is null.  Even using jQuery to do:

jQuery(document).ready(function() {addCallback(myFunction);})

doesn't help.

Any ideas on how to do this?

--

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


Reply via email to