iterate

[code]<table width="100%" bgcolor="#FFFFFF" class="EE" border="0"
bordercolor="red">
<!-- 流程卡产品基本信息 -->
<!-- 操作项信息 -->

<logic:notEmpty name="pmProducts">
<logic:iterate id="prds" name="pmProducts">
<tr>
<td colspan="6" align="center">
流程卡
</td>
</tr>
<tr>
<td align="right">
生-3j-
</td>
<td colspan="4" align="right">
编号
</td>
<td align="left">
<bean:write name="prds" property="sn" />
</td>
</tr>
<tr class="" bgcolor="#fff7e5">
<td align="right">
项目名称
</td>
<td align="left">
<bean:write name="prds" property="projectName" />
</td>
<td align="right">
产品名称
</td>
<td align="left">
<bean:write name="prds" property="proName" />
</td>
<td align="right">
令号
</td>
<td align="left">
<bean:write name="prds" property="productNo" />
</td>
</tr>
</logic:iterate>
</logic:notEmpty>

<logic:notEmpty name="pmOperationList">
<logic:iterate id="oper" name="pmOperationList">
<tr>
<td>
<bean:define id="aa" name="oper" property="list"></bean:define>
<!-- operationSize : 生产操作项的总个数 -->
<bean:size id="operationSize" name="aa"/>
查询结果共有 <bean:write name='operationSize' /> 条
</td>
</tr>

<%
int colOfRow = 3;//定义每行显示的操作项的个数
int rowSize= operationSize/colOfRow;//每 colOfRow 个操作项显示在一行,这是显示的整行的个数
for(int i=0;i<rowSize;i++){
System.out.println("//每 colOfRow 个操作项显示在一行,这是显示的整行的个数");
String rowBeginIdx=new Integer(i*colOfRow).toString();//设置每行开始显示的 操作项的index
%>
<tr class="" bgcolor="#fff7e5">
<logic:iterate id="operation" name="oper" property="list" indexId="index" offset="<%=rowBeginIdx %>" length="<%=new Integer(colOfRow).toString() %>">
<td align="right">
<bean:write name="operation" property="operationName" />
</td>
<td align="left">
<html:text name="operation" property="personName" />
</td>

</logic:iterate>
</tr>
<%
}
int remainder = operationSize%colOfRow;//因为操作项不一定正好是 colOfRow 的正数倍,这是余数
String beginIdxOfRemain = new Integer(rowSize*colOfRow).toString();//这是余数的idx,即剩余的操作项从beginIdxOfRemain开始

for(int m=0;m<remainder;m++){
%>
<tr class="" bgcolor="#fff7e5">
<logic:iterate id="operation" name="oper" property="list" indexId="index" offset="<%=beginIdxOfRemain %>">
<td align="right">
<bean:write name="operation" property="operationName" />
</td>
<td align="left">
<html:text name="operation" property="personName" />
</td>

</logic:iterate>
</tr>
<%
}
%>
</logic:iterate>
</logic:notEmpty>
</table>[/code]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值