Alert component message text munging bug and workaround

I just posted a workaround on the London MMUG web site regarding a nasty little bug with the Alert component cropping the end of long message texts. Hope this prevents someone out there from doubting their sanity and/or losing copious amounts of hair!

8 Responses to “Alert component message text munging bug and workaround”


  1. 1 JesterXL

    Another hack is to just add an “\n” (or newline keyword) to the end of the string.

  2. 2 aral

    Nice fix, Jesse — I assume it works with any-length string? (Will test when I get a moment!)

  3. 3 aral

    Jesse,

    I just tried this and, depending on the width (again), you may need more than one newline character but it works like a charm :)

    I still want to take a few minutes to create a more permanent hack that will be transparent to the developer.

  4. 4 will

    Funny how this just came up as I had just used my own solution. My problem was that I need to format the box to a specific width as my errors are listed in a bulleted fashion and I did not want them to cut off into a new line:


    var errorStr:String = “You had the following errors in your request:\n\n”;
    if (!theaterIDArr) errorStr += “* Select one or more theaters from the list above.\n”
    if (!reportTypeArr) errorStr += “* Select one or more export options below.\n”;

    An easy way to increase the width was to just add a bit of spaces to the Alert windows title!

    Since you can see your errors below the title you can guess the right amount of spaces.

    Sounds cheap, but it works great and is a really simple hack:


    var title:String = “PDF Request Error “;
    var errorStr:String = “You had the following errors in your request:\n\n”;
    if (!theaterIDArr) errorStr += “* Select one or more theaters from the list above.\n”
    if (!reportTypeArr) errorStr += “* Select one or more export options below.\n”;

    HTH

  5. 5 will

    well the extra spaces did not come in through teh HTML, however, you get the picture. Give it a shot!

  6. 6 vinodvv

    Thanks a ton for the fix.
    I have already lost my hair, I could have saved them, If I did a google search earlier.

  7. 7 Pavan

    Thanks a ton for the fix.

    It saved a lot of our time. If I did a google search earlier.

  8. 8 Aral

    You’re very welcome, glad you found it useful :)

Leave a Reply






Bad Behavior has blocked 0 access attempts in the last 7 days.