`
yaojialing
  • 浏览: 253300 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

在showModalDialog 窗口里实现分页

    博客分类:
  • JAVA
阅读更多

因业务需要,在模式对话框里也要实现分页,网上搜到有两个技巧:

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>

 

分享到:
评论
2 楼 yaojialing 2011-10-17  
lihua2008love 写道
请问linkto这个参数需要传什么啊?

传你的URL
1 楼 lihua2008love 2011-09-05  
请问linkto这个参数需要传什么啊?

相关推荐

Global site tag (gtag.js) - Google Analytics