SPR-4700 - Add single checkbox input macro for Velocity and Freemarker
This commit is contained in:
@@ -296,6 +296,23 @@
|
||||
<input type="hidden" name="_${status.expression}" value="on"/>
|
||||
</#macro>
|
||||
|
||||
<#--
|
||||
* formCheckbox
|
||||
*
|
||||
* Show a single checkbox.
|
||||
*
|
||||
* @param path the name of the field to bind to
|
||||
* @param attributes any additional attributes for the element (such as class
|
||||
* or CSS styles or size
|
||||
-->
|
||||
<#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>
|
||||
<input type="hidden" name="_${id}" value="on"/>
|
||||
<input type="checkbox" id="${id}" name="${id}" checked="${checked}" ${attributes}/>
|
||||
</#macro>
|
||||
|
||||
<#--
|
||||
* showErrors
|
||||
*
|
||||
|
||||
@@ -269,6 +269,21 @@
|
||||
<input type="hidden" name="_${status.expression}" value="on"/>
|
||||
#end
|
||||
|
||||
#**
|
||||
* springFormCheckbox
|
||||
*
|
||||
* Show a single checkbox.
|
||||
*
|
||||
* @param path the name of the field to bind to
|
||||
* @param attributes any additional attributes for the element (such as class
|
||||
* or CSS styles or size
|
||||
*#
|
||||
#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}/>
|
||||
#end
|
||||
|
||||
#**
|
||||
* springShowErrors
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user