You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by bw...@apache.org on 2006/05/10 00:06:37 UTC
svn commit: r405553 -
/tapestry/tapestry4/branches/branch-3-0/contrib/src/org/apache/tapestry/contrib/form/CheckBoxMultiplePropertySelectionRenderer.java
Author: bwallace
Date: Tue May 9 15:06:34 2006
New Revision: 405553
URL: http://svn.apache.org/viewcvs?rev=405553&view=rev
Log:
[TAPESTRY-232] Added label for and id to checkbox
Modified:
tapestry/tapestry4/branches/branch-3-0/contrib/src/org/apache/tapestry/contrib/form/CheckBoxMultiplePropertySelectionRenderer.java
Modified: tapestry/tapestry4/branches/branch-3-0/contrib/src/org/apache/tapestry/contrib/form/CheckBoxMultiplePropertySelectionRenderer.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/branches/branch-3-0/contrib/src/org/apache/tapestry/contrib/form/CheckBoxMultiplePropertySelectionRenderer.java?rev=405553&r1=405552&r2=405553&view=diff
==============================================================================
--- tapestry/tapestry4/branches/branch-3-0/contrib/src/org/apache/tapestry/contrib/form/CheckBoxMultiplePropertySelectionRenderer.java (original)
+++ tapestry/tapestry4/branches/branch-3-0/contrib/src/org/apache/tapestry/contrib/form/CheckBoxMultiplePropertySelectionRenderer.java Tue May 9 15:06:34 2006
@@ -81,6 +81,8 @@
writer.beginEmpty("input");
writer.attribute("type", "checkbox");
writer.attribute("name", component.getName());
+ String id = component.getName() + "." +model.getValue(index);
+ writer.attribute("id", id);
writer.attribute("value", model.getValue(index));
if (component.isDisabled())
@@ -94,7 +96,10 @@
writer.println();
writer.begin("td");
+ writer.begin("label");
+ writer.attribute("for", id);
writer.print(model.getLabel(index));
+ writer.end(); // <label>
writer.end(); // <td>
writer.end(); // <tr>