1.aciton处理:
String[] arr=ServletActionContext.getRequest().getParameterValues("check");
String str="'"+arr[0].toString()+"'";
for(int i=0;i<arr.length;i++)
{
str=str+","+"'"+arr+"'";//
}
flow.setFlowId(str);
2.sql语句:
<delete id="delete-Flow" parameterClass="Flow">
delete Pub_Flow e where e.FLOWID in ($flowId$)
</delete>
3.页面显示:
<%@ page language="java" contentType="text/html;charset=GBK"%>
<%@page import="com.exeerp.sm.bean.Page"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>审批流程管理</title>
<link href="css/style.css" rel="stylesheet"/>
<script language="JavaScript" type="text/javascript">
function ff()
{
window.showModalDialog("flowadd.jsp",window,"status:no;scroll:yes;dialogWidth:500px;dialogHeight:500px;");
}
function chooseAll()
{
var selects = document.getElementsByName("check");
for(var j=0;j<selects.length;j++)
{
selects[j].checked=true;
}
}
//反选
function fanselect()
{
var selects = document.getElementsByName("check");
for(var j=0;j<selects.length;j++)
{
if(selects[j].checked==true)
{
selects[j].checked=false;
}else
{
selects[j].checked=true;
}
}
}
function panduan()
{
alert("haha");
var cked = false;
var inputs=document.getElementsById("check");
var selectedNum = 0;
for (var j=0;j<inputs.length;j++) //获取选中数量
{
if (inputs[j].checked == true)
{
selectedNum += 1;
}
}
if (selectedNum==0) {
alert("必须选择一个");
return false;
}else{
if(confirm("您确定要删除")){
cked=true;
return true;
}else{
return false;
}
}
</script>
</head>
<body>
<%int i=1;%>
你好
<h3><a href="flowadd.jsp">新增审批流程信息</a></h3>
<a href="../sm_flowstep/flowstepmain.jsp">进入审批环节管理主页</a>
<s:form theme="simple" action="./deleteAction-Flow.action" οnsubmit="return panduan()">
<table>
<tr height="20px" bgcolor="red">
<td>选择<br></td>
<td>序号<br></td>
<td>审批编号<br></td>
<td>审批名称<br></td>
<td>审批路径<br></td>
<td>审批描述<br></td>
<td>修改<br></td>
<td>添加审批环节<br></td>
</tr>
<s:iterator value="all">
<tr οnmοuseοver="this.style.backgroundColor='#cccccc'" οnmοuseοut="this.style.backgroundColor=''">
<td><s:checkbox name="check" id="check" fieldValue="%{FLOWID}" > </s:checkbox> <br></td>
<td><%=i++%></td>
<td><s:property value="FLOWID"/></td>
<td><s:property value="FLOWNAME"/></td>
<td><s:property value="FLOWURL"/></td>
<td><s:property value="FLOWCLASS"/></td>
<td><a href="findByIdAction-Flow.action?id=<s:property value="FLOWID"/>">修改</a><br></td>
<td><a href="../sm_flowstep/flowstepadd.jsp?id=<s:property value="FLOWID"/>">添加审批环节</a><br></td>
</tr>
</s:iterator>
<tr><td><s:submit value="删除" οnclick="return panduan()"/></td>
<td><input type="button" value="全选/全不选" οnclick="chooseAll()"/></td>
<td><input type="button" value="反 选" οnclick="fanselect()"/></td>
<td><a href="findAllAction-Flow.action?flow.currentpage=1">首 页</a>
<a href="findAllAction-Flow.action?flow.currentpage=<s:property value="flow.lastPage"/>">上一页</a>
<a href="findAllAction-Flow.action?flow.currentpage=<s:property value="flow.nextPage"/>">下一页</a>
<a href="findAllAction-Flow.action?flow.currentpage=<s:property value="flow.countpage"/>">尾 页</a>
<s:property value="flow.currentpage"/>/<s:property value="flow.countpage"/>
</td>
<td width="80px">
共<s:property value='countdate'/>条数据</td>
</tr>
</table>
</s:form>
</body>
</html>
注:显示效果如下:
批量删除
最新推荐文章于 2022-06-01 21:35:05 发布