struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r750604 - in /struts/sandbox/trunk/struts2-jquery-plugin/src/main: java/org/apache/struts2/jquery/ java/org/apache/struts2/jquery/components/ resources/ resources/org/ resources/org/apache/ resources/org/apache/struts2/ resources/org/apache...
Date Thu, 05 Mar 2009 21:41:14 GMT
Author: wesw
Date: Thu Mar  5 21:41:13 2009
New Revision: 750604

URL: http://svn.apache.org/viewvc?rev=750604&view=rev
Log:
migrating tags to allow new themes and for users to customize themes
Changing utils.js and validation.js to be JQuery-ified
not yet working

Added:
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/JQueryPluginConstants.java
      - copied, changed from r750456, struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/JQueryPluginStatics.java
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/static/
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/static/jqueryUtils.js
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/validation.js
Removed:
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/JQueryPluginStatics.java
Modified:
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryForm.java
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryHead.java
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryReset.java
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQuerySubmit.java
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryTextField.java
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/struts-plugin.xml
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-validate.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl

Copied: struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/JQueryPluginConstants.java
(from r750456, struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/JQueryPluginStatics.java)
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/JQueryPluginConstants.java?p2=struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/JQueryPluginConstants.java&p1=struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/JQueryPluginStatics.java&r1=750456&r2=750604&rev=750604&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/JQueryPluginStatics.java
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/JQueryPluginConstants.java
Thu Mar  5 21:41:13 2009
@@ -7,7 +7,7 @@
  * Time: 1:22:20 PM
  * To change this template use File | Settings | File Templates.
  */
-public class JQueryPluginStatics {
-
-    public static final String THEME_NAME = "jquery";
+public class JQueryPluginConstants {
+    
+    public static final String DEFAULT_THEME = "struts.jquery.default.theme";
 }

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryForm.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryForm.java?rev=750604&r1=750603&r2=750604&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryForm.java
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryForm.java
Thu Mar  5 21:41:13 2009
@@ -3,8 +3,9 @@
 import org.apache.struts2.components.Form;
 import org.apache.struts2.views.annotations.StrutsTagAttribute;
 import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.jquery.JQueryPluginStatics;
+import org.apache.struts2.jquery.JQueryPluginConstants;
 import com.opensymphony.xwork2.util.ValueStack;
+import com.opensymphony.xwork2.inject.Inject;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -32,6 +33,12 @@
     }
 
     @Override
+    @Inject(JQueryPluginConstants.DEFAULT_THEME)
+    public void setDefaultUITheme(String theme) {
+        this.defaultUITheme = theme;
+    }
+
+    @Override
     public void evaluateParams() {
         super.evaluateParams();
 
@@ -43,11 +50,6 @@
         }
     }
 
-    @Override
-    public String getTheme() {
-        return JQueryPluginStatics.THEME_NAME;
-    }
-
     @StrutsTagAttribute(description="for specifying whether the result of the action of this
form will be processed " +
         "by javascript, or if the form should be posted like a normal", type="Boolean", defaultValue="true")
     public void setAjaxResult(String ajaxResult) {

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryHead.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryHead.java?rev=750604&r1=750603&r2=750604&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryHead.java
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryHead.java
Thu Mar  5 21:41:13 2009
@@ -2,8 +2,9 @@
 
 import org.apache.struts2.components.Head;
 import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.jquery.JQueryPluginStatics;
+import org.apache.struts2.jquery.JQueryPluginConstants;
 import com.opensymphony.xwork2.util.ValueStack;
+import com.opensymphony.xwork2.inject.Inject;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletRequest;
@@ -27,8 +28,9 @@
     }
 
     @Override
-    public String getTheme() {
-        return JQueryPluginStatics.THEME_NAME;
+    @Inject(JQueryPluginConstants.DEFAULT_THEME)
+    public void setDefaultUITheme(String theme) {
+        this.defaultUITheme = theme;
     }
 
 }

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryReset.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryReset.java?rev=750604&r1=750603&r2=750604&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryReset.java
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryReset.java
Thu Mar  5 21:41:13 2009
@@ -1,8 +1,9 @@
 package org.apache.struts2.jquery.components;
 
 import org.apache.struts2.components.Reset;
-import org.apache.struts2.jquery.JQueryPluginStatics;
+import org.apache.struts2.jquery.JQueryPluginConstants;
 import com.opensymphony.xwork2.util.ValueStack;
+import com.opensymphony.xwork2.inject.Inject;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -21,7 +22,8 @@
     }
 
     @Override
-    public String getTheme() {
-        return JQueryPluginStatics.THEME_NAME;
+    @Inject(JQueryPluginConstants.DEFAULT_THEME)
+    public void setDefaultUITheme(String theme) {
+        this.defaultUITheme = theme;
     }
 }

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQuerySubmit.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQuerySubmit.java?rev=750604&r1=750603&r2=750604&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQuerySubmit.java
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQuerySubmit.java
Thu Mar  5 21:41:13 2009
@@ -2,8 +2,9 @@
 
 import org.apache.struts2.components.Submit;
 import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.jquery.JQueryPluginStatics;
+import org.apache.struts2.jquery.JQueryPluginConstants;
 import com.opensymphony.xwork2.util.ValueStack;
+import com.opensymphony.xwork2.inject.Inject;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -27,7 +28,8 @@
     }
 
     @Override
-    public String getTheme() {
-        return JQueryPluginStatics.THEME_NAME;
+    @Inject(JQueryPluginConstants.DEFAULT_THEME)
+    public void setDefaultUITheme(String theme) {
+        this.defaultUITheme = theme;
     }
 }

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryTextField.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryTextField.java?rev=750604&r1=750603&r2=750604&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryTextField.java
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryTextField.java
Thu Mar  5 21:41:13 2009
@@ -2,8 +2,9 @@
 
 import org.apache.struts2.components.TextField;
 import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.jquery.JQueryPluginStatics;
+import org.apache.struts2.jquery.JQueryPluginConstants;
 import com.opensymphony.xwork2.util.ValueStack;
+import com.opensymphony.xwork2.inject.Inject;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -27,7 +28,8 @@
     }
 
     @Override
-    public String getTheme() {
-        return JQueryPluginStatics.THEME_NAME;
+    @Inject(JQueryPluginConstants.DEFAULT_THEME)
+    public void setDefaultUITheme(String theme) {
+        this.defaultUITheme = theme;
     }
 }

Added: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/static/jqueryUtils.js
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/static/jqueryUtils.js?rev=750604&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/static/jqueryUtils.js
(added)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/org/apache/struts2/static/jqueryUtils.js
Thu Mar  5 21:41:13 2009
@@ -0,0 +1,99 @@
+/*
+ * $Id: $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+var StrutsJQueryUtils = {};
+
+// gets an object with validation errors from string returned by 
+// the ajaxValidation interceptor
+StrutsJQueryUtils.getValidationErrors = function(data) {
+  if(data.indexOf("/* {") == 0) {
+    return eval("( " + data.substring(2, data.length - 2) + " )");
+  } else {
+    return null;
+  }  
+};
+
+StrutsJQueryUtils.clearValidationErrors = function(formId) {
+  clearErrorMessages(formId);
+};  
+
+// shows validation errors using functions from xhtml/validation.js
+// or css_xhtml/validation.js
+StrutsJQueryUtils.showValidationErrors = function(form, errors) {
+  StrutsJQueryUtils.clearValidationErrors(form, errors);
+    
+  if(errors.fieldErrors) {
+    for(var fieldName in errors.fieldErrors) {
+      for(var i = 0; i < errors.fieldErrors[fieldName].length; i++) {
+        addErrorJquery( $("#"+form+" > input[name="+fieldName+"]"), 
+                 errors.fieldErrors[fieldName][i]);
+      }
+    }
+  }
+};
+
+StrutsJQueryUtils.firstElement  = function(parentNode, tagName) {
+  var node = parentNode.firstChild;
+  while(node && node.nodeType != 1){
+    node = node.nextSibling;
+  }
+  if(tagName && node && node.tagName && node.tagName.toLowerCase()
!= tagName.toLowerCase()) {
+    node = StrutsJQueryUtils.nextElement(node, tagName);
+  }
+  return node;  
+};
+
+StrutsJQueryUtils.nextElement = function(node, tagName) {
+  if(!node) { return null; }
+  do {
+    node = node.nextSibling;
+  } while(node && node.nodeType != 1);
+
+  if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase())
{
+    return StrutsJQueryUtils.nextElement(node, tagName);
+  }
+  return node;  
+};
+
+StrutsJQueryUtils.previousElement = function(node, tagName) {
+  if(!node) { return null; }
+  if(tagName) { tagName = tagName.toLowerCase(); }
+  do {
+    node = node.previousSibling;
+  } while(node && node.nodeType != 1);
+  
+  if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase())
{
+    return StrutsJQueryUtils.previousElement(node, tagName);
+  }
+  return node;  
+};
+
+StrutsJQueryUtils.addOnLoad = function(func) {
+  $().ready(func);
+};
+
+StrutsJQueryUtils.addEventListener = function(element, name, observer, capture) {
+  if (element.addEventListener) {
+    element.addEventListener(name, observer, false);
+  } else if (element.attachEvent) {
+    element.attachEvent('on' + name, observer);
+  }
+};

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/struts-plugin.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/struts-plugin.xml?rev=750604&r1=750603&r2=750604&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/struts-plugin.xml (original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/struts-plugin.xml Thu Mar
 5 21:41:13 2009
@@ -45,4 +45,6 @@
         </result-types>
     </package>    
     -->
+    <constant name="struts.jquery.default.theme" value="jquery" />
+
 </struts>

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl?rev=750604&r1=750603&r2=750604&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-close-validate.ftl
Thu Mar  5 21:41:13 2009
@@ -48,17 +48,16 @@
     }
 
     function validateFormCb_${parameters.id}( responseText, textStatus ) {
-        // var form = $("${parameters.id}").get(0); // need the actual DOM element, not the
JQuery obj
-        var form = document.getElementById("${parameters.id}");
+        
         //clear previous validation errors, if any
-        StrutsUtils.clearValidationErrors(form);
+        StrutsJQueryUtils.clearValidationErrors("${parameters.id}");
 
         //get errors from response
-        var errorsObject = StrutsUtils.getValidationErrors(responseText);
+        var errorsObject = StrutsJQueryUtils.getValidationErrors(responseText);
 
         //show errors, if any
         if(errorsObject && errorsObject.fieldErrors) {
-            StrutsUtils.showValidationErrors(form, errorsObject);
+            StrutsJQueryUtils.showValidationErrors("${parameters.id}", errorsObject);
         }
         else {
 <#if (parameters.ajaxResult?default(false) == true ) && parameters.method?contains("post")>

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-validate.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-validate.ftl?rev=750604&r1=750603&r2=750604&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-validate.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/form-validate.ftl
Thu Mar  5 21:41:13 2009
@@ -23,7 +23,7 @@
    TODO rather than going with traditional onclick handler, it would be nice to move to $().live("click",
...
 -->
 <#if parameters.validate?default(true) == true>
-	<script type="text/javascript" src="${base}/struts/xhtml/validation.js"></script>
+	<script type="text/javascript" src="${base}/struts/jquery/validation.js"></script>
 	<#if parameters.onsubmit??>
 		${tag.addParameter('onsubmit', "${parameters.onsubmit}; return validateForm_${parameters.id}();")}
 	<#else>

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl?rev=750604&r1=750603&r2=750604&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/head.ftl
Thu Mar  5 21:41:13 2009
@@ -1,6 +1,6 @@
 <#--
 /*
- * $Id: head.ftl 590812 2007-10-31 20:32:54Z apetrelli $
+ * $Id: $
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -21,6 +21,6 @@
  */
 -->
 <link rel="stylesheet" href="<@s.url value='/struts/xhtml/styles.css' includeParams='none'
encode='false' />" type="text/css"/>
-<#include "/${parameters.templateDir}/simple/head.ftl" />
+<script src="${base}/struts/jqueryUtils.js" type="text/javascript"></script>
 
-<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"></script>
+<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js" type="text/javascript"></script>

Added: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/validation.js
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/validation.js?rev=750604&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/validation.js
(added)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery/validation.js
Thu Mar  5 21:41:13 2009
@@ -0,0 +1,76 @@
+/*
+ * $Id: validation.js 692578 2008-09-05 23:30:16Z davenewton $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+function clearErrorMessages(form) {
+    clearErrorMessagesJquery(form);
+}
+
+function clearErrorMessagesJquery(form) {
+
+    $("#"+form+" > tr[errorFor!=null]").remove();
+}
+
+function clearErrorLabels(form) {
+    clearErrorLabelsJquery(form);
+}
+
+function clearErrorLabelsJquery(form) {
+    $("#"+form+"> .errorLabel").addClass("label").removeClass("errorLabel");
+}
+
+function addError(e, errorText) {
+    addErrorJquery(e, errorText);
+}
+
+function addErrorJquery(e, errorText) {
+    try {
+        var row = (e.type ? e : e[0]);
+        while(row.nodeName.toUpperCase() != "TR") {
+            row = row.parentNode;
+        }
+        var table = row.parentNode;
+        var error = document.createTextNode(errorText);
+        var tr = document.createElement("tr");
+        var td = document.createElement("td");
+        var span = document.createElement("span");
+        td.align = "center";
+        td.valign = "top";
+        td.colSpan = 2;
+        span.setAttribute("class", "errorMessage");
+        span.setAttribute("className", "errorMessage"); //ie hack cause ie does not support
setAttribute
+        span.appendChild(error);
+        td.appendChild(span);
+        tr.appendChild(td);
+        tr.setAttribute("errorFor", e.id);
+        table.insertBefore(tr, row);
+
+        // update the label too
+        //if labelposition is 'top' the label is on the row above
+        var labelRow = row.cells.length > 1 ? row : StrutsUtils.previousElement(tr, "tr");
+        var label = labelRow.cells[0].getElementsByTagName("label")[0];
+        if (label) {
+            label.setAttribute("class", "errorLabel");
+            label.setAttribute("className", "errorLabel"); //ie hack cause ie does not support
setAttribute
+        }
+    } catch (e) {
+        alert(e);
+    }
+}



Mime
View raw message