-
FEATURED COMPONENTS
First time here? Check out the FAQ!
There is the issue I have. I have a login page that handles authentication, this works, then it forwards to my main page which displays the page and this works. The problem I have is that under certain circumstances I need to ask the user a question and when I show the dialog I get “doModal must be called in an event listener”.
Here is a sample of the code:
public class MainWindowController extends AbstractZKController {
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
Messagebox.show("My question");//will cause the error
}
I need a way to post an event automatically after my main page loads in order to have the event listeners fired and my dialog opened to ask the user a question.
Thanks
You could use a Timer:
Timer timer = new Timer(0); timer.setRepeats(false); timer.setPage(page); timer.addEventListener("onTimer", new EventListener() { public void onEvent(Event event) throws Exception { // ask question } });
/Daryl
Asked: 2011-12-14 14:34:02 +0800
Seen: 204 times
Last updated: Dec 28 '11