<s:iterator使用一

本文介绍了一个基于Struts框架实现的团购活动管理系统表格展示部分。该表格用于展示不同活动名称、厂商名称等详细信息,并允许用户自行维护出货日期。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

<table class="simple" style="width: 680px; margin-top: 10px"
  class="simple">
  <tr>
   <th class="simple" style="width: 30px">
    項次
   </th>
   <th class="simple" style="width: 100px">
    活動名稱
   </th>
   <th class="simple" style="width: 100px">
    廠商名稱
   </th>
   <th class="simple" style="width: 50px">
    兌換券
   </th>
   <th class="simple" style="width: 80px">
    團購費
   </th>
   <th class="simple" style="width: 80px">
    數量
   </th>
   <th class="simple" style="width: 100px">
    小計
   </th>
   <th class="simple" style="width: 80px">
    出貨日期
   </th>
  </tr>
  <s:iterator value="detailResult" var="detail" status="stat">
   <tr>
    <td class="simple">
     <s:property value="#stat.index+1" />
    </td>
    <td class="simple">
     <s:set var="mycategory" value="activity.activityCategory"/>
     <s:property value="activity.activityName" />
    </td>
    <td class="simple">
     <s:property value="activity.mainProduct.organization.orgname" />
    </td>
    <td class="simple">
     <s:if test='activity.iscoupon.equals("Y")'>是</s:if>
     <s:else>否</s:else>
    </td>
    <td class="simple">
     <s:text name="format.price">
      <s:param value="groupPrice" />
     </s:text>
    </td>
    <td class="simple">
      <DIV align="right">
     <s:property value="%{qty}" /></DIV>
    </td>
    <td class="simple">
    <DIV align="right">
     <s:text name="format.price">
      <s:param value="groupPrice*qty" />
     </s:text></DIV>
    </td>
    <td>
     <s:if test='activity.iscoupon.equals("N") && orderMain.status.equals("Shipped")'>
      <s:textfield name="shippingDate" cssClass="easyui-datebox" cssStyle="width: 70px;"></s:textfield>
     </s:if>
     <s:else>
      <s:date name="shippingDate" format="yyyy/MM/dd" />
     </s:else>
    </td>

   </tr>
  </s:iterator>

 </table>

就类似于asp.net中的gridview。出货日期可自行维护,文本框显示

后台获取值时,用这个

String[] inputDate=this.getRequest().getParameterValues("shippingDate");

然后就可以用inputDate[0].ToString()或者inputDate[1].ToString()来获取用户到底输入了什么?

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值