Tapestry
  1. Tapestry
  2. TAPESTRY-1309

clearValidationDecorations in validation.js has huge performance issues with many form elements

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.2
    • Component/s: JavaScript
    • Labels:
      None
    • Environment:
      Win IE6, IE7, FF1.5(mac os x) and Safari(mac os x)

      Description

      In validation.js this method causes performances issues in IE6, IE7, FF1.5(mac) and Safari if you have around 4000 or more checkboxes within the form (in the case of adding and removing category tree nodes). This was not an issue with Tapestry 4.0.2.

      /**

      • Clears out previous css classes set on fields
      • in error.
        */
        clearValidationDecorations:function(form, props){
        for (var i=0; i< form.elements.length; i++) {
        if (dj_undef("type", form.elements[i]) || typeof form.elements[i].type == "undefined"
        form.elements[i].type == "submit"
        form.elements[i].type == "hidden") { continue; }

      dojo.html.removeClass(form.elements[i], this.missingClass);
      dojo.html.removeClass(form.elements[i], this.invalidClass);
      }
      },

      The performance issues that we found:
      IE6/7 - browser locks up with hour glass for close to 3 minutes before it hits the listener method
      Safari - browser locks up and eventually quits
      FF (mac) - long running script processing prompt that asks to continue or stop script

      When we commented this method out the performance issues went away. We also tried adding || form.elements[i].type == "checkbox" to the continue statement which worked but was still slower than usability testing allows.

        Activity

        Hide
        Jesse Kuhnert added a comment -

        I think this new method will be much quicker - but please of course re-open / file a new issue if it still isn't quite fast enough. (I got lazy and didn't actually create a sample form with thousands of input nodes but do know what I've done will be faster ...so we'll see )

        Show
        Jesse Kuhnert added a comment - I think this new method will be much quicker - but please of course re-open / file a new issue if it still isn't quite fast enough. (I got lazy and didn't actually create a sample form with thousands of input nodes but do know what I've done will be faster ...so we'll see )

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Anna Vo
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development