PDA

View Full Version : Listener codes strangely interpreted.



G.edwin
11 May 2010, 5:47 AM
Hi,

I'm trying to show a MessageBox.wait() while i'm building a pop-up, through a toolButton. I use GXT 2.1.1, and GWT 1.7



ToolButton.addListener(Events.Select, new Listener<BaseEvent>(){
public void handleEvent(BaseEvent be) {
wait = MessageBox.wait("Area Edition feature", "Recovering datas...", "loading...");
invokePopup();
wait.close();
}
});


But, the wait message don't appear. After some test, i have noticed that the messageBox appeared only after the last listener's instruction (for that test i have just remove 'wait.close()').

Any idea to solve this problem (and display the wait message IN the listener) will be welcome ! ;)

sven
11 May 2010, 5:57 AM
that code will show and close the messagebox right away. you wont be able to see it. You need to defer the closing.

G.edwin
19 May 2010, 11:36 PM
The problem is, even if i remove the wait.close() the messageBox appeared once my Pop up have been instanciate and displayed....
For exemple i also try this :



toolButton.addListener(Events.Select, new Listener<BaseEvent>(){
public void handleEvent(BaseEvent be) {
Info.display("Loading", "...loading pop up please wait");
invokePopup();
}
});
But, the Info appeared just a little 1/10 of sec at the same time that my Pop up appeared. So i guess the Info.display is exectued but, there is no display refreshing so i can't see the Info.display until the loading of my pop-up is finished, and that we leave the listener.