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

        Anna Vo created issue -
        Jesse Kuhnert made changes -
        Field Original Value New Value
        Fix Version/s 4.1.2 [ 12312202 ]
        Jesse Kuhnert made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Jesse Kuhnert [ jkuhnert ]
        Resolution Fixed [ 1 ]
        Mark Thomas made changes -
        Workflow jira [ 12398423 ] Default workflow, editable Closed status [ 12569180 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12569180 ] jira [ 12590439 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development