You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2014/07/30 09:16:47 UTC

[11/17] git commit: Checks is ListValueKey was defined and returns value

Checks is ListValueKey was defined and returns value


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

Branch: refs/heads/develop
Commit: ed8a0b87b29114ac5c99838e7d4cfc819ad71e43
Parents: a2791a8
Author: Lukasz Lenart <lu...@apache.org>
Authored: Fri Jun 27 12:55:43 2014 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Fri Jun 27 12:55:43 2014 +0200

----------------------------------------------------------------------
 core/src/main/resources/template/simple/select.ftl | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/ed8a0b87/core/src/main/resources/template/simple/select.ftl
----------------------------------------------------------------------
diff --git a/core/src/main/resources/template/simple/select.ftl b/core/src/main/resources/template/simple/select.ftl
index f4f27bf..dcb4b97 100644
--- a/core/src/main/resources/template/simple/select.ftl
+++ b/core/src/main/resources/template/simple/select.ftl
@@ -72,9 +72,12 @@
         <#if parameters.listValueKey??>
           <#-- 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 valueKey = stack.findString(parameters.listValueKey) />
+          <#if valueKey??>
+              <#assign itemValue = struts.getText(valueKey) />
+          <#else>
+              <#assign itemValue = parameters.listValueKey />
+          </#if>
         <#elseif parameters.listValue??>
             <#if stack.findString(parameters.listValue)??>
               <#assign itemValue = stack.findString(parameters.listValue)/>