从Map< List< Object>>获取Select标签的列表基于迭代器索引 [英] Getting List for Select tag from Map<List<Object>> based on iterator index

查看:112
本文介绍了从Map< List< Object>>获取Select标签的列表基于迭代器索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有地图,其中包含列表,如下所示。

I have a Map containing Lists 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&lt; List&lt; Object&gt;&gt;获取Select标签的列表基于迭代器索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆