Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Modal dialog question

    I'm porting an application originally written to use swing and I have a problem with modal dialogs.
    Code:
    String result = String.valueOf(MOptionPane.showMessageDialog(null, "Show message test", "Title Test", MOptionPane.INFO_TYPE, MOptionPane.YES_NO_CANCEL_BUTTONS));
    This will create my dialog window inherited from com.smartgwt.client.widgets.Window

    Is there any possibility to wait until buttton is pressed before go forward and assign the "result"? The original app has lots of such calls and it will be too painfull to rewrite the logic to be based on events.

    thanks before

    #2
    I hope that I'm wrong and someone will came with a solution but from what I know it is not be possible (except while(1) with 100% cpu).

    I even had to make asynchronous recursivity one time... not pretty at all...

    Comment


      #3
      If you want it to be synchronous you can use the native confirm() and prompt() functions (built into the browser) but of course those dialogs can't be customized at all.

      while(1) will not work by the way.

      Comment


        #4
        mihai007, Isomorphic, thanks for your answers.

        Comment


          #5
          As far as I know ExtJS has modal dialog implementation.

          I think they cover whole screen with some DIV with high zIndex (which does not react to mouse or keyboard) and on top of that DIV show dialog window.

          Maybe it is possible to implement it in SmartClient?

          Alius.

          Comment


            #6
            Modality is built in (Window.isModal). What this poster was looking for is a dialog that blocks execution until the user has responded, like the native alert() function.

            Comment


              #7
              Originally posted by Isomorphic
              Modality is built in (Window.isModal). What this poster was looking for is a dialog that blocks execution until the user has responded, like the native alert() function.
              Sorry - my bad - I did not check API before writing.

              Alius

              Comment


                #8
                dialog that blocks execution until the user has responded, like the native alert() function.
                Hi,

                I am looking for the same solution. I need to show onbeforeclose confirmation in one class, and close a window in another class. I prefer not entering 2 events to handle it. Are there any news for it in GWT 2.0?


                thank you

                Comment

                Working...
                X