fixed checkbox macro (SPR-6120)

This commit is contained in:
Juergen Hoeller
2009-09-18 14:42:36 +00:00
parent 8e800f0322
commit 6420fd303b
4 changed files with 12 additions and 12 deletions

View File

@@ -307,10 +307,10 @@
-->
<#macro formCheckbox path attributes="">
<@bind path />
<#local checked><#if status.value?? && status.value?string=="true">true<#else>false</#if></#local>
<#local id><#if status.expression??>${status.expression}<#else>${path}</#if></#local>
<#assign id="${status.expression}">
<#assign isSelected = status.value?? && status.value?string=="true">
<input type="hidden" name="_${id}" value="on"/>
<input type="checkbox" id="${id}" name="${id}" checked="${checked}" ${attributes}/>
<input type="checkbox" id="${id}" name="${id}"<#if isSelected> checked="checked"</#if> ${attributes}/>
</#macro>
<#--

View File

@@ -280,8 +280,8 @@
*#
#macro( springFormCheckbox $path $attributes )
#springBind($path)
<input type="hidden" name="_${status.expression}" value="on"/>
<input type="checkbox" id="${status.expression}" name="${status.expression}" checked="#if("$!{status.value}"=="true")true#{else}false#end" ${attributes}/>
<input type="hidden" name="_${status.expression}" value="on"/>
<input type="checkbox" id="${status.expression}" name="${status.expression}"#if("$!{status.value}"=="true") checked="checked"#end ${attributes}/>
#end
#**
@@ -293,7 +293,7 @@
* @param separator the html tag or other character list that should be used to
* separate each option. Typically '<br>'.
* @param classOrStyle either the name of a CSS class element (which is defined in
* the template or an external CSS file) or an inline style. If the value passed in here
* the template or an external CSS file) or an inline style. If the value passed in here
* contains a colon (:) then a 'style=' attribute will be used, else a 'class=' attribute
* will be used.
*#