updating ListUIBean updating java-backed bean
Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/6def5145 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/6def5145 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/6def5145 Branch: refs/heads/feature/WW-4295-localization Commit: 6def514524e81c4af188b47b6694384eea3a46c6 Parents: 7f586d3 Author: adam brin <adam.b...@asu.edu> Authored: Mon Mar 24 07:31:54 2014 -0700 Committer: adam brin <adam.b...@asu.edu> Committed: Mon Mar 24 07:31:54 2014 -0700 ---------------------------------------------------------------------- .../java/org/apache/struts2/components/ListUIBean.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/6def5145/core/src/main/java/org/apache/struts2/components/ListUIBean.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/components/ListUIBean.java b/core/src/main/java/org/apache/struts2/components/ListUIBean.java index b1a4493..69deae4 100644 --- a/core/src/main/java/org/apache/struts2/components/ListUIBean.java +++ b/core/src/main/java/org/apache/struts2/components/ListUIBean.java @@ -48,6 +48,7 @@ import java.util.Map; public abstract class ListUIBean extends UIBean { protected Object list; protected String listKey; + protected String listValueKey; protected String listValue; protected String listCssClass; protected String listCssStyle; @@ -108,6 +109,13 @@ public abstract class ListUIBean extends UIBean { addParameter("listKey", "key"); } + if (listValueKey != null) { + listValueKey = stripExpressionIfAltSyntax(listValueKey); + addParameter("listValueKey", listValueKey); + } else if (value instanceof Map) { + addParameter("listValueKey", "valueKey"); + } + if (listValue != null) { listValue = stripExpressionIfAltSyntax(listValue); addParameter("listValue", listValue); @@ -147,6 +155,11 @@ public abstract class ListUIBean extends UIBean { this.listKey = listKey; } + @StrutsTagAttribute(description = " Property of list objects to get field value label from") + public void setListValueKey(String listValueKey) { + this.listValueKey = listValueKey; + } + @StrutsTagAttribute(description = "Property of list objects to get field content from") public void setListValue(String listValue) { this.listValue = listValue;