牛骨文教育服务平台(让学习变的简单)
博文笔记

Velocity foreach 获取下标和size

创建时间:2013-12-11 投稿人: 浏览次数:3655


 

$!{velocityCount}数量是从1开始的,所以获取下标直接-1就可以了,关于总数量直接$!{list.size()}。 
Html代码  
  1. #foreach($fundDet in $!list)  
  2.                     <tr bgcolor="#f3f3f3">  
  3.                     <td><input name="" type="checkbox" value="" style="border:none"/></td>  
  4.                     <td height="32px">$!{velocityCount}</td>  
  5.                     <td height="32px">$!{list.size()}</td><!-- debitAmt -->  
  6.                     <td height="32px">$!{fundDet.creditAmt}</td>  
  7.                     <td height="32px">$!{fundDet.profitAmt}</td>  
  8.                     <td height="32px">$!{fundDet.fundSource}</td>  
  9.                     <td height="32px">$!{fundDet.preBalance}</td>  
  10.                     <td height="32px">$!{fundDet.balance}</td>  
  11.                     <td height="32px">$!{fundDet.transSerial}</td>  
  12.                     <td height="32px">$!{fundDet.transDate}</td>  
  13.                     <td height="32px">$!{fundDet.transTime}</td>  
  14.                     <td height="32px">$!{fundDet.comments}</td>  
  15.                     <td height="32px">$!{fundDet.status}</td>  
  16.                     <td height="32px">$!{fundDet.settleDate}</td>  
  17.                 </tr>  
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。