DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13854>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13854

<html:form...> tag doesn't support "focus" with control arrays

           Summary: <html:form...> tag doesn't support "focus" with control
                    arrays
           Product: Struts
           Version: 1.0.2 Final
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Custom Tags
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


We had a problem when we were trying to set focus to a set of radio buttons.  
This was because the current code apparently only supports single controls.  In 
my testing, in the "endTag" method I changed:

            results.append("    document.forms[\"");
            results.append(name);
            results.append("\"].elements[\"");
            results.append(tempFocus);
            results.append("\"]");
            if (refocus.length() > 1) {
                results.append(refocus.toString());
            }
            results.append(".focus()\r\n");

to:

        results.append("  var focusControl = document.forms[\"");
        results.append(name);
        results.append("\"].elements[\"");
            results.append(tempFocus);
            results.append("\"]");
            if (refocus.length() > 1) {
                results.append(refocus.toString());
            }
        results.append("\r\n");

        results.append("  if (focusControl.name == null)\r\n");
        results.append("  {\r\n");
        results.append("     focusControl = focusControl[0];\r\n");
        results.append("  }\r\n");
        results.append("  focusControl.focus();\r\n");

This seems to work fine.

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>

Reply via email to