Chinaunix首页 | 论坛 | 博客
  • 博客访问: 948684
  • 博文数量: 168
  • 博客积分: 3853
  • 博客等级: 中校
  • 技术积分: 1854
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-15 23:50
文章分类

全部博文(168)

文章存档

2014年(12)

2013年(46)

2012年(60)

2011年(11)

2010年(1)

2009年(17)

2008年(21)

我的朋友

分类: 系统运维

2011-11-16 09:21:48

在parent页面打开child.jsp,  点击open时候会跳出空白页面和一个'打开和保存'对话框 .

解决方案如下:点击open时候, 下载action在父页面的iframe中加载, 利用的是window.open的  opener引用. 


parent.jsp
  1. <iframe id='downloadiframe' style='visibility:hidden'></iframe>
  2. <script defer="defer">
  3. var cachePdf;

  4. var download = function() {
  5.      var doc = document.getElementById('downloadiframe').contentDocument || document.frames['downloadiframe'].document;
  6.     doc.location = "DisplayStatementAction.do";
  7.     cachePdf.close();
  8. };
  9. <logic:equal name="<%=subAppContextName%>" property="pdfCachePopUpSupported" value="true">
  10.    <%
  11.   VstmtContext vstmtContext = (VstmtContext)session.getAttribute("/apest/esonline/vstmt/VstmtContext");
  12.   vstmtContext.setPdfCachePopUpSupported(Boolean.FALSE);
  13.   %>
  14.   cachePdf=window.open ('SetupDisplayStatementPop.do', 'PdfCachePopUp', 'height=200px,width=400px,top=200px,left=300px,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no, status=no');
  15. </logic:equal>
  16. </script>



child.jsp
  1. 1. <form method="POST" action="SetupDisplayStatementPop.do" onsubmit="processUnload()">
  2.    2. <table id="appAsTbl" class="appAsTbl" border="0" cellpadding="3"
  3.    3. cellspacing="0">
  4.    4. <tr>
  5.    5.

  6.    6. <td color="grey" td colspan="6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please note, that the e-Statement will be saved in the temporary files of your browser. Please click OK to proceed or click Cancel to quit.If you want to delete the temporary file from local, please click<a href="#" onclick='javascript:window.open("","","height=650px,width=630px,top=200px,left=300px,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no, status=no");'>More....</a></td>
  7.    7. </tr>
  8.    8. <tr>
  9.    9. <td color="grey">&nbsp;</td>
  10.   10. <td><a ID="link_pdfCacheWarning_Open" class="appNavNext" href="javascript:doOpen();" onClick="logoffOnLeaving=false;" target="_top" title="" >Open</a></td>
  11.   11. <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
  12.   12. <td><a ID="link_pdfCacheWarning_Cancel" class="appNavNext" href="javascript:doClose();" onClick="logoffOnLeaving=false;" target="_top" title="" >Cancel</a></td>
  13.   13.

  14.   14. </tr>
  15.   15. </table>
  16.   16.

  17.   17. <script language="javascript">
  18.   18. function doClose(){
  19.   19. window.close();
  20.   20. }
  21.   21. function doOpen(){
  22.   22. window.opener.download();
  23.   23. }
  24.   24. </script>
  25.   25. </form>

阅读(1005) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~