tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bwall...@apache.org
Subject svn commit: r405553 - /tapestry/tapestry4/branches/branch-3-0/contrib/src/org/apache/tapestry/contrib/form/CheckBoxMultiplePropertySelectionRenderer.java
Date Tue, 09 May 2006 22:06:37 GMT
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>
 



Mime
View raw message