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>