pagefun.jsp
上传用户:huijianzhu
上传日期:2009-11-25
资源大小:9825k
文件大小:1k
- <%@ page contentType="text/html;charset=gb2312" %>
- <%
- int allCount = 0;//总记录条数
- int allPage = 1;//总页数
- int currentPage = 1 ; //当前页
- try{
- currentPage = Integer.parseInt(request.getParameter("currentPage"));
- }catch(Exception e){
- currentPage = 1 ;
- }
- try{
- controller.setRecord(currentPage*range,(currentPage-1)*range); //打开纪录,移动纪录条数
- allCount=controller.getCount(TABLENAME);
- if(allCount%range==0) allPage=allCount/range;
- else allPage=allCount/range+1;
- iterator=controller.getMessage() ;
- }catch(Exception e){
- System.out.println(e);
- }
- %>
- <script language="javascript">
- //分页跳转
- function goPage(form, pageNum) {
- form.currentPage.value = pageNum;
- form.submit();
- }
- //选取所有要删除的选项
- function selectall(f,v){
- //var f = document.forms["xyz"];
- for (i=0;i<f.elements.length;i++)
- {
- f.elements[i].checked = v;
- }
- }
- function submitDelete(form,page){
- var flag=0;
- for (var i=0;i<form.elements.length;i++){
- var e = form.elements[i];
- if(e.name == "id") {
- if( e.checked==true ) {
- flag=1;
- }
- }
- }
- if(flag==0)
- {
- alert("请选择删除的对象");
- return false;
- }
- if(confirm("确实要删除吗?"))
- {
- form.action=page;
- form.submit();
- }
- }
- </script>