[ http://issues.apache.org/struts/browse/STR-2884?page=all ]
Niall Pemberton resolved STR-2884.
----------------------------------
Resolution: Won't Fix
> Javascript focus script fails when <html:xhtml/> is present and the 'id'
> property is set on the form
> ----------------------------------------------------------------------------------------------------
>
> Key: STR-2884
> URL: http://issues.apache.org/struts/browse/STR-2884
> Project: Struts 1
> Issue Type: Bug
> Components: Taglibs
> Affects Versions: 1.2 Family
> Reporter: Frank Premereur
> Priority: Minor
>
> The javascript for putting focus on a field still does not work in
> combination with xhtml, when providing the 'styleId' attribute. A previous
> bugfix, in response to bug id 35127, changed the behaviour such that the form
> is now rendered with the formname as value for id attribute, if no id
> attribute is set on the struts:form tag. The focus javascript still refers to
> the beanName, where it should refer to the value of 'styleId' attribute if
> this has been set.
> This patch works for me:
> --- FormTag.java.orig 2006-03-09 14:32:28.000000000 +0100
> +++ FormTag.java 2006-06-07 11:30:56.104082800 +0200
> @@ -663,7 +663,12 @@
> // Construct the control name that will receive focus.
> // This does not include any index.
> StringBuffer focusControl = new StringBuffer("document.forms[\"");
> - focusControl.append(beanName);
> + if (this.isXhtml() && getStyleId() != null) {
> + focusControl.append(getStyleId());
> + } else {
> + focusControl.append(beanName);
> + }
> +
> focusControl.append("\"].elements[\"");
> focusControl.append(this.focus);
> focusControl.append("\"]");
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira