从Map< List< Object>>获取Select标签的列表基于迭代器索引 [英] Getting List for Select tag from Map<List<Object>> based on iterator index
问题描述
我有地图
,其中包含列表
,如下所示。
I have a Map
containing List
s like below.
Map<String,List<Object>> dynamicList = new HashMap <String,List<Object>>();
在上面的地图
我有像这样的钥匙 dynamiclist1
, dynamiclist5
, dynamiclist6
等
In the above Map
I have keys like dynamiclist1
, dynamiclist5
, dynamiclist6
, etc.
我必须根据下面的另一个迭代器索引显示这个 dynamicList
:
I have to show this dynamicList
based on another iterator index like below:
<s:iterator value="listOne" var="list" status="stat">
<s:select name="col%{#stat.index}"
listKey="KEY"
listValue="VALUE"
list="#dynamicList.dynamiclist%{#stat.index}" />
</s:iterator>
我想要这样的东西#dynamicList.dynamiclist%{#stat.index }
获取该列表。
I want something like this #dynamicList.dynamiclist%{#stat.index}
to get that list.
推荐答案
通过迭代器标记迭代地图 var
属性不是必需的,因为当前项在每次迭代时都被推送到值栈。因此,将地图条目的值
属性引用为列表
集合。
When iterating a map via the iterator tag var
attribute is not necessary, because the current item pushed to the value stack on each iteration. So, referencing value
attribute of the map entry as a list
collection.
<s:iterator value="listOne" status="stat">
<s:select name="col%{#stat.index}"
listKey="KEY"
listValue="VALUE"
list="dynamicList['%{top}']" />
</s:iterator>
这篇关于从Map< List< Object>>获取Select标签的列表基于迭代器索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!