Extends template to use the new field to localise value's label

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/69df8704
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/69df8704
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/69df8704

Branch: refs/heads/feature/WW-4295-localization
Commit: 69df87047ab2a72c339a0ee320459757ba439f40
Parents: 9018936
Author: Lukasz Lenart <lukaszlen...@apache.org>
Authored: Thu Mar 20 08:08:27 2014 +0100
Committer: Lukasz Lenart <lukaszlen...@apache.org>
Committed: Thu Mar 20 08:08:27 2014 +0100

----------------------------------------------------------------------
 core/src/main/resources/template/simple/checkboxlist.ftl | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/69df8704/core/src/main/resources/template/simple/checkboxlist.ftl
----------------------------------------------------------------------
diff --git a/core/src/main/resources/template/simple/checkboxlist.ftl 
b/core/src/main/resources/template/simple/checkboxlist.ftl
index 9662e42..e2e569c 100644
--- a/core/src/main/resources/template/simple/checkboxlist.ftl
+++ b/core/src/main/resources/template/simple/checkboxlist.ftl
@@ -29,16 +29,14 @@
         <#else>
             <#assign itemKey = stack.findValue('top')/>
     </#if>
-  <#if parameters.listValueKey??>
+    <#if parameters.listLabelKey??>
     <#-- checks the valueStack for the 'valueKey.' The valueKey is then 
looked-up in the locale 
        file for it's localized value.  This is then used as a label -->
-    <#assign itemValue = stack.findString(parameters.listValueKey)/>
-    <#-- FIXME: find a better way to get the value than a call to @s.text -->
-    <#assign itemValue><@s.text name="${itemValue}"/></#assign>
+        <#assign itemValue = 
struts.getText(stack.findString(parameters.listLabelKey))/>
     <#elseif parameters.listValue??>
         <#assign itemValue = 
stack.findString(parameters.listValue)?default("")/>
-        <#else>
-            <#assign itemValue = stack.findString('top')/>
+    <#else>
+         <#assign itemValue = stack.findString('top')/>
     </#if>
     <#if parameters.listCssClass??>
         <#if stack.findString(parameters.listCssClass)??>

Reply via email to