BTW, I have found that the Javascript generated here does not seem to
work well with Netscape 4.7 (Windows). It focusses on the field at
first, but jumps to the browser's "Address" field when you press tab.
For this browser/platform, it does work correctly when put into the
body tag -- onload="document.logonForm.username.focus();"
[EMAIL PROTECTED] wrote:
craigmcc01/03/06 14:09:53
Modified:src/doc release-notes-1.0-b2.xml struts-html.xml
src/share/org/apache/struts/taglib/html FormTag.java
Log:
Correct the JavaScript generated to implement the "focus" attribute of the
html:form tag so that it works even when you use nested or indexed property
expressions for the field you want initial focus on.
Submitted by: Hal Deadman [EMAIL PROTECTED]
PR: Bugzilla #714
Revision ChangesPath
1.2 +6 -0 jakarta-struts/src/doc/release-notes-1.0-b2.xml
Index: release-notes-1.0-b2.xml
===
RCS file: /home/cvs/jakarta-struts/src/doc/release-notes-1.0-b2.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- release-notes-1.0-b2.xml 2001/03/06 20:40:35 1.1
+++ release-notes-1.0-b2.xml 2001/03/06 22:09:49 1.2
@@ -36,6 +36,8 @@
liThe codelt;html:linkgt;/code tag now accepts an optional
codeanchor/code attribute, to allow the inclusion of a
(possibly calculated) anchor ("#xxx") in the generated hyperlink./li
+liThe codelt;html:basegt;/code tag now accepts an optional
+codetarget/code attribute./li
/ul
pThe following new features have been added to the
@@ -70,6 +72,10 @@
hyperlink value./li
liThe codelt;html:linkgt;/code tag now correctly places any
specified anchor ("#xxx") in the generated hyperlink./li
+liThe JavaScript code generated to implement the codefocus/code
+attribute of the codelt;html:formgt;/code tag now works even
+when you use nested or indexed property expressions. Previously,
+this would generate an invalid JavaScript reference to the field./li
/ul
pThe following changes and bug fixes to the Struts Documentation
1.19 +10 -0 jakarta-struts/src/doc/struts-html.xml
Index: struts-html.xml
===
RCS file: /home/cvs/jakarta-struts/src/doc/struts-html.xml,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- struts-html.xml 2001/03/06 17:04:18 1.18
+++ struts-html.xml 2001/03/06 22:09:50 1.19
@@ -41,6 +41,16 @@
took place (which is where the browser would normally resolve
relative references against)./p
/info
+
+ attribute
+nametarget/name
+requiredfalse/required
+rtexprvaluetrue/rtexprvalue
+info
+ pThe window target for this base reference./p
+/info
+ /attribute
+
/tag
tag
1.7 +8 -7
jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java
Index: FormTag.java
===
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FormTag.java 2001/03/06 16:58:24 1.6
+++ FormTag.java 2001/03/06 22:09:52 1.7
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v 1.6
2001/03/06 16:58:24 craigmcc Exp $
- * $Revision: 1.6 $
- * $Date: 2001/03/06 16:58:24 $
+ * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v 1.7
2001/03/06 22:09:52 craigmcc Exp $
+ * $Revision: 1.7 $
+ * $Date: 2001/03/06 22:09:52 $
*
*
*
@@ -85,7 +85,7 @@
* properties correspond to the various fields of the form.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.6 $ $Date: 2001/03/06 16:58:24 $
+ * @version $Revision: 1.7 $ $Date: 2001/03/06 22:09:52 $
*/
public class FormTag extends TagSupport {
@@ -556,10 +556,11 @@
results.append("script language=\"JavaScript\"");
results.append(" type=\"text/javascript\"\r\n");
results.append(" !--\r\n");
- results.append("document.");
+ results.append("document.forms[\"");
results.append(name);
- results.append(".");
- results.append(focus);
+ results.append("\"].elements[\"");
+results.append(focus);
+