From 2030220d708a6909c46a779b22e69ee532eca7bd Mon Sep 17 00:00:00 2001 From: rjy7 Date: Wed, 16 Mar 2011 18:25:52 +0000 Subject: [PATCH] Add template macro to generate a list of hidden input form fields from a map passed from the controller. --- .../web/templates/freemarker/lib/lib-form.ftl | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/webapp/web/templates/freemarker/lib/lib-form.ftl b/webapp/web/templates/freemarker/lib/lib-form.ftl index 4be19d79d..555ca4060 100644 --- a/webapp/web/templates/freemarker/lib/lib-form.ftl +++ b/webapp/web/templates/freemarker/lib/lib-form.ftl @@ -5,9 +5,9 @@ <#-- Macro: optionGroups - Output a sequence of option groups with options. + Output: a sequence of option groups with options. - Input is a map of option groups to lists of Option objects. + Input: a map of option groups to lists of Option objects. Usage: <@optionGroups groups=myOptionGroups /> --> @@ -24,9 +24,9 @@ <#-- Macro: options - Output a sequence of options. + Output: a sequence of options. - Input is a list of Option objects. + Input: a list of Option objects. Usage: <@options opts=myOptions /> --> @@ -36,4 +36,21 @@ -<#----------------------------------------------------------------------------> \ No newline at end of file +<#----------------------------------------------------------------------------> + +<#-- + Macro: hiddenInputs + + Output hidden inputs from a map of names to values. + + Input: a map of strings (names) to strings (values). May be null. + + Usage: <@hiddenInputs inputs /> +--> +<#macro hiddenInputs inputs=""> + <#if inputs?has_content> + <#list inputs?keys as name> + + + + \ No newline at end of file