Commits

Anonymous committed 3196263

all tests pass, but there are some missing tests. time to create them

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@127573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (4)

src/java/templates/xhtml/checkbox.vm

 <td colspan="2">
 <table width="100%" >
 <tr>
-  <td valign="top" align="right"><input type="checkbox" name="${tag.Name}" id="${tag.Name}" #if( ${tag.Value} )value="${tag.Value}" #end#if( ${tag.ActualValue.toString()} == "true" )checked="checked"#end/></td>
-  <td><label for="${tag.Name}">$!{labelValue}</label></td>
+    <td valign="top" align="right"><input
+        type="checkbox"
+        #if ($parameters.name)      name="$parameters.name"     #end
+        #if ($parameters.name)      id="$parameters.name"       #end
+        #if ($parameters.value)     value="$parameters.value"   #end
+        #if ($parameters.value == "true")   checked="checked"   #end
+    /></td>
+    <td><label for="$parameters.name">$!parameters.label</label></td>
 </tr>
 </table>
 </td>

src/test/com/opensymphony/webwork/views/jsp/ui/Checkbox-1.txt

 <td colspan="2">
 <table width="100%" >
 <tr>
-  <td valign="top" align="right"><input type="checkbox" name="myname" id="myname" value="foo" /></td>
-  <td><label for="myname">{mylabel}</label></td>
+  <td valign="top" align="right"><input type="checkbox" name="myname" id="myname" value="bar" /></td>
+  <td><label for="myname">mylabel</label></td>
 </tr>
 </table>
 </td>

src/test/com/opensymphony/webwork/views/jsp/ui/Checkbox-2.txt

 <table width="100%" >
 <tr>
   <td valign="top" align="right"><input type="checkbox" name="myname" id="myname" /></td>
-  <td><label for="myname">{mylabel}</label></td>
+  <td><label for="myname">mylabel</label></td>
 </tr>
 </table>
 </td>

src/test/com/opensymphony/webwork/views/jsp/ui/CheckboxTest.java

 
         CheckboxTag tag = new CheckboxTag();
         tag.setPageContext(pageContext);
-        tag.setLabel("mylabel");
-        tag.setName("myname");
+        tag.setLabel("'mylabel'");
+        tag.setName("'myname'");
         tag.setValue("foo");
 
         int result = tag.doEndTag();
 
         CheckboxTag tag = new CheckboxTag();
         tag.setPageContext(pageContext);
-        tag.setLabel("mylabel");
-        tag.setName("myname");
+        tag.setLabel("'mylabel'");
+        tag.setName("'myname'");
 
         int result = tag.doEndTag();