PopUp not visible

29 views
Skip to first unread message

Deepak Singh

unread,
Nov 27, 2012, 1:22:58 PM11/27/12
to google-we...@googlegroups.com
Hi,


Based on an event, i invoke a long running task. 
Before the task starts, i show a pop up to the user and when the task finishes, the pop up is hide.

Code:

final PopupPanel pp = HotelClientUtil.getUpdatingPopup();
pp.center();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
resetFilter();
pp.hide();
}
});

The problem is that the pop up is not shown even for a micro seconds.
As soon as i trigger the event, the page gets blocked till it completes the execution.

What i want is to make the pop up visible till the task continues.

What wrong i am doing here?

--
Deepak Singh

Jens

unread,
Nov 27, 2012, 1:34:21 PM11/27/12
to google-we...@googlegroups.com
If I remember correctly PopupPanel also uses a deferred command to reposition itself to the center and then reveal itself. So the browser may not have enough time to show it before your blocking task runs because both deferred commands are executed right after each other.

The best thing you can do is to make your task non blocking. You and your users never want a web application that totally freezes the web browser. Whatever your task do, split it up in smaller parts and use a RepeatingCommand along with Scheduler.get().scheduleIncremental() to give the browser enough time to do all the things it needs to do without freezing.

-- J.
Reply all
Reply to author
Forward
0 new messages