I solved this way:

1) i "hard code" a DIV (id="wait_glass1") in my html, and set this
style for it: style="position: absolute; visibility:visible; top: 0px;
left: 0px; width: 100%; height: 100%; background-color:#000000;
filter: Alpha(Opacity=50); opacity: 0.5;".

2) hardcode a second DIV (id="wait_glass2") with
style="position:absolute; left:0px; top:0px; width:100%; height:
100%;", this DIV contents my "loading, please wait" message

 I hardcode both DIV's in html because them are showed inmediatly,
before GWT loads

3) surround your delayed code this way (for example):

public void onModuleLoad()
        {
                // force image preload
                Image.prefetch("img/carro.gif");
                Image.prefetch("img/centro.gif");
                Image.prefetch("img/der.gif");
                Image.prefetch("img/izq.gif");
                GWT.runAsync(new RunAsyncCallback() {

                        @Override
                        public void onSuccess()
                        {
                                .... code to be executed
delayed ......
        
RootPanel.get("wait_glass1").getElement().getStyle().setVisibility(Visibility.HIDDEN);
        
RootPanel.get("wait_glass2").getElement().getStyle().setVisibility(Visibility.HIDDEN);
                        }
                        public void onFailure(Throwable reason)
                        {
                                Window.alert("error loading program");
                        }
                });
        }

this code shows wait_glass1 and wait_glass2 during download, and hides
them after all delayed code is downloaded and executed, and after all
your images are downloaded


On 1 feb, 01:40, zixzigma <[email protected]> wrote:
> it is a common practice to display a "Loading" message/icon
> when we have an operation that possibly would take some time to complete.
> for example when retrieving data from Datastore, etc.
>
> I was wondering how we can do the same for Activities/Places.
> in GWT MVP, when navigating from one place to another,
> an activity stops and another one gets started,
> however at times there is a slight delay in between.
>
> do you have any suggestions on how we can display a "Loading" message,
> when transitioning between Activity/Places ?
>
> Thank You

-- 
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