<html>
<form name="form1" method="post" action="">
<tr>
<table>
<tr>
<td>
<input type="checkbox" name="checkAll" value="" onClick="selectAll('checkAll','chkId');GetAllId(this,'temp','chkId');" title="全选">选择</td>
</td>
<td>
员工编号
</td>
</tr>
<logic:notEmpty name="rs">
<logic:iterate name="rs" id="itm">
<tr>
<td>
<input name="chkId" type="checkbox" id="chkId" value="<bean:write name="itm" property="id">" onClick="selectOne('checkAll');GetId(this,'temp');">
</td>
<td><bean:write name="itm" property="userid"/></td>
</tr>
</logic:iterate>
</logic:notEmpty>
</table>
<table>
<td>
<input name="button1" type="button" value="添加" onclick="location.href='/pams/page/param/add.jsp">
<input name="button2" type="button" value="删除" onclick="chicIt('del');">
<input name="button3" type="button" value="修改" onclick="chicIt('modi');">
</td>
</table>
</tr>
<input type="hidden" name="temp" value="">
</form>
</html>
<script language="javascript">
function chicIt(it){
if(it=='del'){
if((document.getElementById("temp").value=="")){
window.alert("请选择记录进行删除");
}else{
if(window.confirm("/n是否确定删除?")){
location.href="/pams/fundratAction.shtml?action=empdele &id="+document.getElementById("temp").value;
}
}
}else if (it=="modi"){
if((document.getElementById("temp").value=="")){
window.alert("请选择一条记录进行修改");
}else{
var oldvalue='提示:你仅更新一条记录';
if(document.getElementById('temp').value.indexOf(",")>0){
oldvalue='提示:正在更新记录';
}
location.href='/pams/page/param/utilUpdateParam.jsp?id='+document.getElementById('temp').value+'&oldValue='+oldValue+'<% if(request.getAttribute("urlParam")!=null) out.print((String)request.getAttribute("urlParam")); %>&action=/pams/FundrateAction.shtml?action=update';
}
}
}
</script>
=====================================DAO======================================
public ActionForward delete(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String id = request.getParameter("id");
try {
if (!CFormat.isEmpty(id)) {
String idArray[] = id.split(",");
for (int i = 0; i < idArray.length; i++) {
dao.delete(ParamRmbdepositrate.class, idArray[i]);
}
request.setAttribute("info", "删除参数成功!");
}
} catch (Exception ex) {
request.setAttribute("info", "删除参数失败,请重试!");
request.setAttribute("historyBack", "true");
}
request.setAttribute("result", "/pams/rmbckll.shtml?action=list");
return mapping.findForward("result");
}