struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbened...@apache.org
Subject svn commit: r601213 - /struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java
Date Wed, 05 Dec 2007 05:46:20 GMT
Author: pbenedict
Date: Tue Dec  4 21:46:14 2007
New Revision: 601213

URL: http://svn.apache.org/viewvc?rev=601213&view=rev
Log:
STR-3112: Correct javascript to focus on indexed field

Modified:
    struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java

Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java?rev=601213&r1=601212&r2=601213&view=diff
==============================================================================
--- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java (original)
+++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java Tue
Dec  4 21:46:14 2007
@@ -705,14 +705,22 @@
         results.append(isXhtml() ? "//<![CDATA[" : "<!--");
         results.append(lineEnd);
 
+        // Construct the index if needed and insert into focus statement
+        String index = "";
+        if (this.focusIndex != null) {
+            StringBuffer sb = new StringBuffer("[");
+            sb.append(this.focusIndex);
+            sb.append("]");
+            index = sb.toString();
+        }
+        
         // Construct the control name that will receive focus.
-        // This does not include any index.
         StringBuffer focusControl = new StringBuffer("document.forms[\"");
-
         focusControl.append(beanName);
         focusControl.append("\"].elements[\"");
         focusControl.append(this.focus);
         focusControl.append("\"]");
+        focusControl.append(index);
 
         results.append("  var focusControl = ");
         results.append(focusControl.toString());
@@ -726,19 +734,7 @@
         results.append("focusControl.style.display != \"none\") {");
         results.append(lineEnd);
 
-        // Construct the index if needed and insert into focus statement
-        String index = "";
-
-        if (this.focusIndex != null) {
-            StringBuffer sb = new StringBuffer("[");
-
-            sb.append(this.focusIndex);
-            sb.append("]");
-            index = sb.toString();
-        }
-
         results.append("     focusControl");
-        results.append(index);
         results.append(".focus();");
         results.append(lineEnd);
 



Mime
View raw message