PDA

View Full Version : MessageBox.wait



Leif_Bork
1 Sep 2010, 3:30 AM
When I run

MessageBox messageBox = MessageBox.wait(a, b, c);
[Then execute code.]
messageBox.close();

Then the code is executed before the waiting dialog is rendered. It should, of course, be executed afterwards.

How can I implement this correctly, not making it a race condition?

(What events does a Dialog fire after render? Any methods I can override in Dialog that will make this work? I already tried overriding both afterRender and onRender. Events are incredibly poorly documented! )

Please, help!

sven
1 Sep 2010, 3:39 AM
It probably wont work like that. As the browser is in a hang and does not update the UI.

Try something like this:


MessageBox messageBox = MessageBox.wait(a, b, c);
DeferredCommand.addCommand(new Command(){
public void execute(){
[Then execute code.]
messageBox.close();
}
});

Leif_Bork
1 Sep 2010, 4:33 AM
Thank you very much!