I'm asking this question as something of a GWT n00b, hoping this will
be easy to solve.

I'm on a project trying to use GWT 2.0 to build an embed API, similar
to Google Maps or wave. The idea is for the API to be used in a
context similar to the following:

<code>
<html>
<head>
  <script src="http://greatapi.com/great_api_1-0.js"/> <!-- ie. the
bootloader widget.noscript.js file from gwt... -->
  <script>
     var widget;
     function loadit() {
         widget = new Widget("Some init params");
         widget.bind("herewego");
     }
     function showit() {
         widget.show();
     }
  </script>
</head>
<body onload="loadit">

We'll embed our widget in this div...
<div id="herewego"/>

<button onclick="showit()"/>Show it</button>

</body>
</html>
</code>

So far, we've been able to create the relevant objects and methods and
expose them via the org.timepedia.exporter.client.Exporter library to
achieve the effect we want.

So far, so good. However the problem we run into is that the
bootloader (widget.nocache.js) file, which is called and executed
before loadit() method, calls the <MD5>.cache file, which contains the
'Exportable' annotations, asynchronously, and as such may be loaded
and parsed AFTER the onload event has fired. This means that often the
"widget = new Widget()" call, initated by the onLoad event, will fail.

Is there any easy way to ensure that objects available are once the
bootstrap has been downloaded and parsed, OR have some kind of
callback provided so that once the <MD5>.cache file has been
downloaded, we can continue using the API?

Any suggestions appreciated.

--

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.


Reply via email to