Monday, August 9, 2010

Re: onModuleLoad() Before Page Load

Hi Ryan,

This doesn't answer your question, but I was wondering why you had the
velocity template initiate attaching your widgets to your spans?

Another possibility is to have velocity write a list of span ids to a
hidden span, and then have your GWT component (in a startup module)
read that span and attach widgets to each span in turn. That's the
way I do things.

Thanks,
Dan

On Aug 6, 7:54 pm, Ryan McDonald <ryan.mcdona...@gmail.com> wrote:
> To my understanding, the compiled GWT file <module-name>.nocache.js
> blocks page evaluation when it is loading. When it finishes, it
> creates a hidden iframe that begins to load the <module-name>.cache.js
> file but it does NOT block page evaluation and loads asynchronously.
>
> In my GWT module I define a native Javascript function using JSNI that
> adds a widget to the page.
>
> I use a Velocity Template that dynamically generates divs with unique
> ids, then call my Javascript method that I defined using JSNI to
> attach the widget to the specific div.
>
> The problem is that when my page is loading, and the Velocity Template
> calls my Javascript method, the hidden iframe has not finished loading
> the <module-name>.cache.js that defines the method.
>
> Is there a way to make the <module-name>.cache.js file load
> synchronously so that it will block page evaluation until it finishes
> loading? Or make onModuleLoad() run before the page loads completely?
> Something along these lines?

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate