<s:iterator使用一

来源:互联网 发布:java 限制登录次数 编辑:程序博客网 时间:2024/05/22 09:04
 

<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()来获取用户到底输入了什么?

 

 

原创粉丝点击