[ http://issues.apache.org/struts/browse/WW-769?page=comments#action_37959
]
tm_jee commented on WW-769:
---------------------------
changes are at :-
Sending src/main/java/org/apache/struts2/components/Form.java
Sending src/main/java/org/apache/struts2/components/FormButton.java
Sending src/main/java/org/apache/struts2/components/Submit.java
Sending src/main/java/org/apache/struts2/components/UIBean.java
Adding src/test/java/org/apache/struts2/components/FormButtonTest.java
Adding src/test/java/org/apache/struts2/components/UIBeanTest.java
Transmitting file data ......
Committed revision 431149.
The fix is basically to have a protected method
protected void populateComponentHtmlId(Form form) {
....
}
which is being used in populateParams() method, subclass like FormButton
(parent of Submit) and Form component overrides when they wish to change the id
used.
Kindly review, Thx.
> UITags do not evaluate id attribute
> -----------------------------------
>
> Key: WW-769
> URL: http://issues.apache.org/struts/browse/WW-769
> Project: Struts 2
> Issue Type: Bug
> Components: Views
> Affects Versions: WW 2.1.7
> Reporter: John Patterson
> Assigned To: tm_jee
> Fix For: 2.0.0
>
>
> The UITags inherit the 'id' property from TagSupport which is not evaluated.
> This means that it cannot be used in a dynamically created form to match a
> lable to a control. Currently, when I click on a lable they all highlight
> the same control!
> I suggest that if no 'id' attribute is specified Webwork should generate a
> unique identifier from the control name appending a number when there is more
> than one control of the same name.
> For example:
> <label for="mycontrol">A control</label> <input type="text" name="mycontrol"
> id="mycontrol"/>
--
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