3 Replies Latest reply on May 8, 2008 12:03 AM by mister_ian

    Alert Formatting

      Hi smile :)

      I'm trying to create a formatted Alert that displays error messages for my application. My problem is this: sometimes, the errors are too long to be supported by the Alert window, causing the error messages to wrap at the top and bottom of the Alert. For this, I tried widening the Alert window to accommodate the longer error messages. However, while the Alert itself widened, the text inside didn't, and still follows the previous size of the Alert. The end result is a wide Alert with "narrow" text inside. Here is the part of my code that pops the Alert:

      Can anyone help me out? Many thanks! :)
        • 1. Re: Alert Formatting
          Hey, maybe try to set the width of the alert box before you show it

          • 2. Re: Alert Formatting
            Bryan Dresselhaus Level 1
            Have you tried creating a custom class that extends the Alert class? You could override the protected methods such as commitProperties to set a larger width and height.
            • 3. Re: Alert Formatting
              mister_ian Level 1
              Thanks for the help!

              I found this link in the LiveDocs, and it says there that it would be better to just use TitleWindow and PopupManager instead of trying to customize an Alert. Someone there also pointed out the same problem that I'm having:


              In the section "Sizing the Alert control" if you set the width, the interior box holding the text does not resize - wider - but leaves quite a margin when increased.

              @dietmar: The same page says that setting the size of the alert after the show() method is called should be enough to set the size of the alert.

              TitleWindow and PopupManager may just be the solution to my problems. Thanks a lot! :)