Return-Path: X-Original-To: apmail-struts-commits-archive@minotaur.apache.org Delivered-To: apmail-struts-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 751EE11755 for ; Fri, 27 Jun 2014 11:06:56 +0000 (UTC) Received: (qmail 43909 invoked by uid 500); 27 Jun 2014 11:06:47 -0000 Delivered-To: apmail-struts-commits-archive@struts.apache.org Received: (qmail 43817 invoked by uid 500); 27 Jun 2014 11:06:47 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 43584 invoked by uid 99); 27 Jun 2014 11:06:47 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jun 2014 11:06:47 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1A2CE98D62B; Fri, 27 Jun 2014 11:06:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lukaszlenart@apache.org To: commits@struts.apache.org Date: Fri, 27 Jun 2014 11:06:56 -0000 Message-Id: <48da869129b04838a4b90669cddfc870@git.apache.org> In-Reply-To: <1822ea5ed926453c87de2ef60d5d05bd@git.apache.org> References: <1822ea5ed926453c87de2ef60d5d05bd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [11/12] 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/feature/WW-4295-localization Commit: ed8a0b87b29114ac5c99838e7d4cfc819ad71e43 Parents: a2791a8 Author: Lukasz Lenart Authored: Fri Jun 27 12:55:43 2014 +0200 Committer: Lukasz Lenart 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 valueKey = stack.findString(parameters.listValueKey) /> + <#if valueKey??> + <#assign itemValue = struts.getText(valueKey) /> + <#else> + <#assign itemValue = parameters.listValueKey /> + <#elseif parameters.listValue??> <#if stack.findString(parameters.listValue)??> <#assign itemValue = stack.findString(parameters.listValue)/>