因业务需要,在模式对话框里也要实现分页,网上搜到有两个技巧:
1. if you are using IE5.5 or 6, try to add this line to your code
<base target="_self">
2. or use a frameset or IFRAME to house your test.jsp
第一点,我试了,貌似不行,还有IE版本限制,我就放弃了,如果有网友知道的顺便跟小弟说一下,呵呵。
我是按第二点做的:
showModalDialog('test_frame.jsp',"")
在'test_frame.jsp'里面加上
<frameset><frame src="<%= linkto %>" name="ifm" scrolling=no noresize></frameset>
在你的分页JS方法中加上window.location.href="你要转到的页面或ACTION",就可以了。
<%@ page language="java" pageEncoding="GB2312"%>
<%
//该页面是用来模式对话框分页
String linkto = request.getParameter("linkto");
linkto=linkto.replace("|", "&");//这里是防止&参数过来时得不到值
String title=request.getParameter("title");
title=new String(title.getBytes("ISO-8859-1"),"gbk");
%>
<html>
<head>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<title><%= title %></title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/include/css/style.css" type="text/css">
</head>
<frameset rows="100" frameborder=no border="0" framespacing="0">
<frame src="<%= linkto %>" name="ifm" scrolling=no noresize>
</frameset><noframes>
<body>
</body>
</noframes>
</html>