Fix FreeMarker form checbox macro generated names

In Spring 3.2 a fix was implemented for all Spring Freemarker form
macros so that generated form input fields have valid bracketless IDs.
In the fix a regression was introduced manifesting in formCheckbox
macro no longer generating appropriate names for checkbox and hidden
input field.

This change fixes mentioned regression issue.

Issue: SPR-8732
This commit is contained in:
Stevo Slavic
2013-03-01 00:17:15 +01:00
committed by Rossen Stoyanchev
parent fbac428e23
commit ba03d5b0c7
3 changed files with 25 additions and 13 deletions

View File

@@ -309,8 +309,8 @@
<@bind path />
<#assign id="${status.expression?replace('[','')?replace(']','')}">
<#assign isSelected = status.value?? && status.value?string=="true">
<input type="hidden" name="_${id}" value="on"/>
<input type="checkbox" id="${id}" name="${id}"<#if isSelected> checked="checked"</#if> ${attributes}/>
<input type="hidden" name="_${status.expression}" value="on"/>
<input type="checkbox" id="${id}" name="${status.expression}"<#if isSelected> checked="checked"</#if> ${attributes}/>
</#macro>
<#--