Struts 标签 两种动态下拉菜单的写法

1、进入页面

public ActionForward searchInit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws IOException, ServletException {
        HttpSession session = request.getSession();
  CustomerInfoListForm theForm = (CustomerInfoListForm) form;
  //客户类型
  //request.setAttribute("customerTypeList", this.getBdCcssCodeList(CcssCodeConstants.CUSTOMER_TYPE_VALUE));
  //维修级别
  //request.setAttribute("repairLevelList", this.getBdCcssCodeList(CcssCodeConstants.REPAIR_LEVEL_VALUE));
  LookupCodeUtil codeUtil = LookupCodeUtil.getInstance();
  try
  {
           //客户类型
           theForm.setCustomerTypeList(codeUtil.getLookupCodes("CUSTOMER_TYPE", getUser(session)));
           //维修级别
           theForm.setRepairLevelList(codeUtil.getLookupCodes("REPAIR_LEVEL", getUser(session)));
  }
  catch (UtilException e)
  {
           e.printStackTrace();
  }
  List list=customerGeneralInfoDS.getList(" FROM EccFndDeptCsV t where t.parentDeptId in (" +
    " select s.deptId from EccFndDept s where s.parentDeptId=1)");
  //区域
  request.setAttribute("areaCodeList", list);
        return (mapping.findForward("searchInit"));
    }

2、前台页面

 

//customerTypeList放在ActionForm中

 <td class="td_title" nowrap="nowrap">客户类型</td>
    <td class="item6">
       <html:select property="detailModelView.subtypeLookupCode" style="width:140PX">
  <option value="" >---请选择---</option>
  <html:optionsCollection name="CustomerInfoListForm" property ="customerTypeList" label="meaning" value="lookupCode" />
  </html:select>
 </td>

 

//areaCodeList放在request中

    <td class="td_title" nowrap="nowrap">区域</td>
    <td class="item6">
     <bean:define id="areaCodeList" name="areaCodeList"></bean:define>
  <html:select property="detailModelView.areaCode" style="width:140PX">
  <option value="" >---请选择---</option>
  <html:options collection="areaCodeList" property="deptId" labelProperty="deptName" />
  </html:select>
    </td>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值