Menu

#741 Window.setMode("modal") shall not suspend even in listener

3.0.4
closed
nobody
5
2008-03-03
2008-02-15
Tom M. Yeh
No

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>

Discussion

  • Tom M. Yeh

    Tom M. Yeh - 2008-02-15

    Logged In: YES
    user_id=91099
    Originator: YES

    Ready in 3.1.0 since 2/15

     
  • Tom M. Yeh

    Tom M. Yeh - 2008-02-15
    • status: open --> closed
     
  • Tom M. Yeh

    Tom M. Yeh - 2008-02-16

    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.

     
  • Tom M. Yeh

    Tom M. Yeh - 2008-03-03

    Logged In: YES
    user_id=91099
    Originator: YES

    The feature is ready since 3.0.4

     
  • Tom M. Yeh

    Tom M. Yeh - 2008-03-03
    • milestone: 801592 --> 3.0.4
     

Log in to post a comment.