You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2004/12/07 15:33:33 UTC

DO NOT REPLY [Bug 15816] - html:form focus in pages with several forms

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=15816





------- Additional Comments From busser@atlas.cz  2004-12-07 15:33 -------
Hi!

I suggest using the 'id' attribute of the form tag only in the case the 
'styleId' attribute of the html:form tag being present. If 'styleId' attribute 
is not present then use the 'name' attribute.

So the change in the Java code would be something like this (in class form, in 
method protected String renderFocusJavascript()):

OLD:
        StringBuffer focusControl = new StringBuffer("document.forms[\"");
***     focusControl.append(beanName);
        focusControl.append("\"].elements[\"");
        focusControl.append(this.focus);
        focusControl.append("\"]");

NEW:
        StringBuffer focusControl = new StringBuffer("document.forms[\"");
***     focusControl.append((styleId != null) ? styleId : beanName);
        focusControl.append("\"].elements[\"");
        focusControl.append(this.focus);
        focusControl.append("\"]");

Sorry about the way I'm suggesting this change - I have no experience with diff 
and patch etc. :(


BTW, the generated JavaScript is fine, please don't use the suggested dot 
notation - document.forms.F001.elements["..."].

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org