Thanks Stefan. :-)

Yes, sorry - I typed that code it when I should have copied and pasted
- it would have been clearer. Here's the whole of my module:

public class FrontPage implements EntryPoint {
        private static final FrontPageClientBundle clientBundle =
GWT.create( FrontPageClientBundle.class );

        public void onModuleLoad() {
 
StyleInjector.injectAtStart( clientBundle.style().getText(), true );
        }
}

I actually don't have any GWT widgets - at least not yet. I just want
to take advantage of GWT's spriting & hashing to begin with, to speed
up the load of an existing page. And it works *really* well, except
for the brief flash at the beginning where the page renders once
without any style information. That's the problem I'm trying to solve.

Any ideas?

Kris

On Jun 25, 6:52 pm, Stefan Bachert <[email protected]> wrote:
> Hi,
>
> I did not get you completely.
> MyClientBundle and MyBundle is a type?
>
> Maybe you could defer the creating of GWT widget by using
> DeferredCommand.
> Then the styles are loaded before creating the GWT-widgets. And you
> can get rid of parameter "true"
>
> Stefan Bacherthttp://gwtworld.de
>
> On Jun 24, 5:33 pm, Kris <[email protected]> wrote:
>
>
>
> > I'm trying to introduce GWT into an existing page, both to get rid of
> > my Javascript headaches, and to take advantage of ClientBundle. I'm
> > using:
>
> >   ...
> >   private static final MyClientBundle myBundle =
> > GWT.create( MyBundle.class );
>
> >   public void onModuleLoad() {
> >     StyleInjector.injectAtStart( myBundle.style().getText(), true );
> >   ...
> >   }
> >   ...
>
> > ...and everything shows up as expected, but on the compiled-down code
> > there's a brief flash of unstyled content (FOUC) before the bundle
> > kicks in. It's the same problem on IE, FF, Safari & Chrome.
>
> > I can see why it's happening - onModuleLoad won't get called until the
> > browser calls onLoad, and by then it's already rendered the page - but
> > I'd like to fix it if I can. (I suppose I can hide the page as it
> > loads and use GWT to make it visible, but that feels a bit hackish.)
> > Does anyone have a proper way to fix 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 [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