6 Replies Latest reply on May 3, 2010 10:51 AM by heiko.braun

    WSModalDialog hiding?

    anil.saldhana

      I have been able to use the WSModalDialog.   But how do you hide it?

       

      I see that the WSModalDialog internally has a WSWindowPanel.  It just has a show() method.  How do I hide it?

        • 1. Re: WSModalDialog hiding?
          anil.saldhana

          To get around I am using a plain WindowPanel.  I like the compactness of the WSModelDialog, the layout, the icons etc.  But the lack of the hide() method is making it unusable.

          • 2. Re: WSModalDialog hiding?
            anil.saldhana

            I have added a hide() method to the WSModalDialog.  I am not sure how this was working, because TheStore -> deleteUser also was not hiding the modal window properly (think the drape panel).

             

            But there is some wierd behavior in WSModalDialog->callback method where the window.hide() call is throwing java.lang.AssertionError which I catch and ignore for now.

             

            The functionality works except for this wierd error that has been caught and ignored to mask the horrid stack trace.

            • 3. Re: WSModalDialog hiding?
              heiko.braun

              You should rely on the mosaic widgets and no the errai ones. They are not well tested and don't offer functionality

              that doesn't exist in mosaic. Apart from maybe the WSGrid. But that's an edge case.

               

              The assertion you see is most probably an assertion in hosted mode which doesn't occur in web mode.

              Is it related to the widget size? 'Cause I know tat the errai widget have problems with that.

              • 4. Re: WSModalDialog hiding?
                anil.saldhana

                It may be something in the hosted mode only.  I was seeing wierd assertion errors in the calls to "window.hide" that some internal UI element was not attached etc.  So just an ignorable try/catch (bad practice)  saves the console logs with horrid exception.

                 

                The WSModalDialog is pretty compact now and does what it is supposed to do.

                • 5. Re: WSModalDialog hiding?
                  anil.saldhana

                  I like WSModalDialog because a couple of lines of code gives me the dockpanel and the proper alignment of the two buttons etc with an icon.  If I have to build the dialog myself, that is probably 15 lines of UI wiring code.

                  • 6. Re: WSModalDialog hiding?
                    heiko.braun

                    OK, whatever works best for you. I saw that have commit access to Errai.

                    That's great. Thanks for the improvements you already made.