You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2011/02/25 10:05:54 UTC

svn commit: r1074446 - /myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js

Author: weber
Date: Fri Feb 25 09:05:54 2011
New Revision: 1074446

URL: http://svn.apache.org/viewvc?rev=1074446&view=rev
Log:
(TOBAGO-974) javascript error when unselectAll in empty simplesheet
<https://issues.apache.org/jira/browse/TOBAGO-974>

Modified:
    myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=1074446&r1=1074445&r2=1074446&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Fri Feb 25 09:05:54 2011
@@ -914,23 +914,25 @@ Tobago.Sheet.prototype.selectAll = funct
 Tobago.Sheet.prototype.unSelectAll = function() {
     var selected = Tobago.element(this.selectedId);
     var row = Tobago.element(this.firstRowId);
-    var image = this.getSelectionElementForRow(row);
-    if (image) {
-      var i = this.firstRowIndex;
-      var j = 0;
-      while (row) {
-        image = this.getSelectionElementForRow(row);
-        if (!image || !image.src || !image.src.match(/Disabled/)) {
-          var re = new RegExp("," + i + ",", 'g');
-          selected.value = selected.value.replace(re, ",");
+    if (row) {
+      var image = this.getSelectionElementForRow(row);
+      if (image) {
+        var i = this.firstRowIndex;
+        var j = 0;
+        while (row) {
+          image = this.getSelectionElementForRow(row);
+          if (!image || !image.src || !image.src.match(/Disabled/)) {
+            var re = new RegExp("," + i + ",", 'g');
+            selected.value = selected.value.replace(re, ",");
+          }
+          i++;
+          row = this.getSiblingRow(row, ++j);
         }
-        i++;
-        row = this.getSiblingRow(row, ++j);
+      } else {
+        selected.value = ",";
       }
-    } else {
-      selected.value = ",";
+      this.updateSelectionView();
     }
-    this.updateSelectionView();
   };
 
 Tobago.Sheet.prototype.toggleAllSelections = function(sheetId) {