在parent页面打开child.jsp, 点击open时候会跳出空白页面和一个'打开和保存'对话框 .
解决方案如下:点击open时候, 下载action在父页面的iframe中加载, 利用的是window.open的 opener引用.
parent.jsp
- <iframe id='downloadiframe' style='visibility:hidden'></iframe>
-
<script defer="defer">
-
var cachePdf;
-
-
var download = function() {
-
var doc = document.getElementById('downloadiframe').contentDocument || document.frames['downloadiframe'].document;
-
doc.location = "DisplayStatementAction.do";
-
cachePdf.close();
-
};
-
<logic:equal name="<%=subAppContextName%>" property="pdfCachePopUpSupported" value="true">
-
<%
-
VstmtContext vstmtContext = (VstmtContext)session.getAttribute("/apest/esonline/vstmt/VstmtContext");
-
vstmtContext.setPdfCachePopUpSupported(Boolean.FALSE);
-
%>
-
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');
-
</logic:equal>
-
</script>
child.jsp
- 1. <form method="POST" action="SetupDisplayStatementPop.do" onsubmit="processUnload()">
-
2. <table id="appAsTbl" class="appAsTbl" border="0" cellpadding="3"
-
3. cellspacing="0">
-
4. <tr>
-
5.
-
-
6. <td color="grey" td colspan="6"> 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. </tr>
-
8. <tr>
-
9. <td color="grey"> </td>
-
10. <td><a ID="link_pdfCacheWarning_Open" class="appNavNext" href="javascript:doOpen();" onClick="logoffOnLeaving=false;" target="_top" title="" >Open</a></td>
-
11. <td> </td><td> </td><td> </td>
-
12. <td><a ID="link_pdfCacheWarning_Cancel" class="appNavNext" href="javascript:doClose();" onClick="logoffOnLeaving=false;" target="_top" title="" >Cancel</a></td>
-
13.
-
-
14. </tr>
-
15. </table>
-
16.
-
-
17. <script language="javascript">
-
18. function doClose(){
-
19. window.close();
-
20. }
-
21. function doOpen(){
-
22. window.opener.download();
-
23. }
-
24. </script>
-
25. </form>
阅读(1093) | 评论(0) | 转发(0) |