Makes this window as a modal dialog. It will automatically center the window (ignoring {@link #getLeft} and{@link #getTop}).
Notice: though both setMode("modal") and doModal() both causes the window to become modal, they are a bit different. doModal causes the event listener to suspend immediately, while setMode("modal") posts an event ( {@link Events#ON_MODAL}). That is, {@link #setMode} won't suspend the execution immediately,but {@link #doModal} will.{@link #doModal} can be called only in an event listener,while {@link #setMode} can be called anytime.
@exception SuspendNotAllowedException if1) not in an event listener;
2) the event thread is disabled.
3) there are too many suspended processing thread than the deployer allows. By default, there is no limit of # of suspended threads.
@exception InterruptedException thrown if the desktop orthe Web application is being destroyed, or {@link org.zkoss.zk.ui.sys.DesktopCtrl#ceaseSuspendedThread}. To tell the difference, check the getMessage method of InterruptedException.
@since 3.0.4