JSP二级下拉框低层的问题

totsheng 2008-12-31 11:46:10

function showSelect(value)
{
if(value=="all")
$("selectzg2").style.display = "none";
else
{
$("selectzg2").style.display = "";
var form=document.forms[0];
form.action="/humanres/empstat.shtml?method=zg2Select";
form.submit();
}
}

<select name="selectzg1" id="selectzg1"
style="width:200;display:none"
onchange="changezg(this);showSelect(this.value);">
<option value="all">
全部资格证书
</option>
<c:forEach items="${zgselect1 }" var="zs1">
<option value="${zs1.LETTER_NAME }">
${zs1.LETTER_NAME }
</option>
</c:forEach>
</select>
<select name="selectzg2" id="selectzg2"
style="width:200;display:none" onchange="changezg(this)">
<option value="all">
全部资格证书
</option>
<c:forEach items="${zgselect2 }" var="zs2">
<option value="${zs2.COMP_NAME }">
${zs2.COMP_NAME }
</option>
</c:forEach>
</select>


public zg2Select(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {

List zg2 = this.getHanton().getEmployeeDAO().getCompNameByLetter(
this.getSessionComCode(request),
this.getParameter(request, "selectzg1"));
this.setAttribute(request, "zgselect2", zg2);

}

请问这个zg2Select的return应该怎么写?
...全文
191 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
totsheng 2009-01-05
  • 打赏
  • 举报
回复
这个问题没有解决,现在我改了实现方式,用JS实现中....
先结贴了,谢谢各位!
chinaboy2005 2009-01-04
  • 打赏
  • 举报
回复
ActionForward af = mapping.findForward("succ"); //succ 对应的是你的配置信息啊
totsheng 2009-01-04
  • 打赏
  • 举报
回复
public ActionForward zg2Select(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {

List zg2 = this.getHanton().getEmployeeDAO().getCompNameByLetter(
this.getSessionComCode(request),
this.getParameter(request, "selectzg1"));
this.setAttribute(request, "zgselect2", zg2);
List hk = this.getHanton().getDictDAO().getValues("CENSUS_PROPRTY");
List wh = this.getHanton().getDictDAO().getValues("EDUCATE");
List zc = this.getHanton().getEmployeeDAO().getPositionName(
this.getSessionComCode(request));
this.setAttribute(request, "coms", this.getAllComs());
this.setAttribute(request, "comCode", this.getSessionComCode(request));
this.setAttribute(request, "hkselect", hk);
this.setAttribute(request, "whselect", wh);
this.setAttribute(request, "zgselect1", this.getParameter(request, "selectzg1"));
this.setAttribute(request, "zgselect2", zg2);
this.setAttribute(request, "zcselect", zc);
return mapping.findForward("newExport");
}

我现在是这样写的
zhouzheng4731 2009-01-04
  • 打赏
  • 举报
回复
你的这个方法是不是写错了啊
应该是这样的啊
public ActionForward zg2Select(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {

List zg2 = this.getHanton().getEmployeeDAO().getCompNameByLetter(
this.getSessionComCode(request),
this.getParameter(request, "selectzg1"));
this.setAttribute(request, "zgselect2", zg2);
ActionForward af = mapping.findForward("succ");//succ 对应的是你的配置信息啊
return af
}
totsheng 2009-01-04
  • 打赏
  • 举报
回复
UP下

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧