Browsers don't re-render the screen until there is a break in the JavaScript
(mostly, there's an old version of FF which used to) otherwise every single
change would mean reflowing the screen elements, etc.
You need to put a break in the programming so it *does* re-render.

So put all the 'do some work' in its own method. X and call that method from
a DeferredCommand. A DeferredCommand gets put in the queue to run after
whatever sets up the DeferredCommand, so there's a break, so the screen gets
re-rendered before your 5-6 second stuff runs.


        Command cmd = new Command()
        {
            @Override
            public void execute()
            {
                doStuffWhilePopupShows();
                popup.hide();
            }
        };
        popup.show();
        DeferredCommand.addCommand(cmd);


Ian

http://examples.roughian.com


2009/7/8 rohan <[email protected]>

>
> I am showing transparent screen using a popup.
>
> On an onclick event of a button Iam showing a popup in an ‘if’ block,
> but the popup is only shown when if returns from the if block, why it
> behaves like this? Is there any other way to show a popup in an ‘if’
> block?
>
> Below is the code
>
>
> if(Condition){
> popup.show();
> do some work;//// it takes 5-6 sec. This time my screen is blocked
> with popup
> popup.hide();
>
>
> }
>
>
> But it is not working, If i remove popup.hide(), popup is shown after
> the IF block executed. So at that time it is useless
>
>
> Can any one help me in this.
>
>
> Thanks
> Rohan
> >
>

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