Steve,
I can't seem to reproduce the problem on my end, but for what it's worth,
latching with a timeout like that is going to be pretty brittle in practice.
Here's an alternative formulation that won't be flaky:

HTML:

  <script>

  function onGwtAppLoaded() {

    alert("w00t!");

  }

  </script>

Java:

  public void onModuleLoad() {

    setLoaded();

  }


  public native void setLoaded() /*-{

    if ($wnd.onGwtAppLoaded) {

      $wnd.onGwtAppLoaded();

    }

  }-*/;

This works because the GWT linkers all make the guarantee that
onModuleLoad() will not be called until the DOM is "ready" (i.e. all the DOM
elements, including the body, are fully-evaluated, including scripts). So
there's no chance that onGwtAppLoaded() will *not* be defined when
onModuleLoad() is called.

Hope this helps,
joel.

On Thu, May 14, 2009 at 12:38 PM, Steve M <ste...@emnico.com> wrote:

>
> Hi,
>
> I am seeing a problem in Internet Explorer whereby it appears that
> onModeulLoad() does not get called.
>
> In the HTML ive added the following to highlight the problem...
>
> <script>
> var t=setTimeout("testLoaded()",30000);
>
> function testLoaded()
> {
>    if (window.Loaded==undefined)
>    {
>        alert("onload didnt run");
>    }
> }
>
> </script>
>
>
> My GWT code...
>
>
>    public void onModuleLoad()
>    {
>        setLoaded();
>
>        ... now initialise the GWT
>    }
>
>
>
>    public native void setLoaded()
>    /*-{
>          $wnd.Loaded = "loaded";
>    }-*/;
>
>
> Intermitently using Internet Explorer, it simply fails to call the
> onModuleLoad() method, and you get the "onload didnt run" method.
>
> Any ideas on this one? Seems quite a serious flaw.
>
> GWT version: 1.5.3
> IE: 7.0.5730.11IC
>
> thanks, Steve M
> >
>

--~--~---------~--~----~------------~-------~--~----~
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-Toolkit@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