六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 87|回复: 0

webwork iterator 遍历双重list

[复制链接]

升级  44%

4

主题

4

主题

4

主题

童生

Rank: 1

积分
22
 楼主| 发表于 2013-2-5 01:22:23 | 显示全部楼层 |阅读模式
经常会需要遍历双层的list,可以用脚本语言,但如果想用标签的话,


下边是个例子:
构造一个双层列表:
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);">outList = new ArrayList();
 
inList
= new ArrayList();
inList.add(
new Element("1","a"));
inList.add(
new Element("2","b"));
outList.add(inList);
 
inList
= new ArrayList();
inList.add(
new Element("3","c"));
inList.add(
new Element("4","d"));
outList.add(inList);

遍历:
<ww:iterator value="outList">
    
<ww:iterator value="top">
          
<ww: property value="key"/>,<ww: property value="value"/>
    
</ww:iterator>
</ww:iterator>
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表