The follow code snippet will generate half-baked window if it is created in an event listener -- for example, you can test it by copying it to zkdemo's Try. It is because setMode("modal") actually calls doModal(), and doModal() suspends the execution.
It is better to always post an event to become a modal window later for this case.
Codes:
<window mode="modal" width="200px">
test
</window>
Logged In: YES
user_id=91099
Originator: YES
Ready in 3.1.0 since 2/15
Logged In: YES
user_id=91099
Originator: YES
Note:
* <p>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.
Logged In: YES
user_id=91099
Originator: YES
The feature is ready since 3.0.4