This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes closing popup window after reference to jsp which's contentType is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "closing popup window after reference to jsp which Watch "closing popup window after reference to jsp which New topic
Author

closing popup window after reference to jsp which's contentType is"application/excel?

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hello I m programming a frontend based on struts framework. The application flows as follows
INPUT JSP -> OUTPUT JSP -> clik export button -> back to INPUT JSP and refence to another JSP with contentType="application/excel-csv" so user can export result list displayed on OUTPUT JSP as an excel file.
here is INPUT JSP snippet where the referencing happens to export as excel file. BUT THE PROBLEM I FACE IS TO CLOSE THE popup window after referencing to that page.
################## snippet START ####################################
.
.
.
<%
String csvExportString = outBean.getCsvExportString();
session.setAttribute("csvExportString", csvExportString);
%>
</logic resent>
<logic resent name="<%= IWPSConstants.OUTPUT_BEAN%>">
<logic resent name="<%=IWPSConstants.OUTPUT_BEAN%>" property="exceed" >
<logic:notEqual name="<%=IWPSConstants.OUTPUT_BEAN%>" property="exceed" value="yes">
<logic resent name="<%=IWPSConstants.OUTPUT_BEAN%>" property="csvExportString">
<logic:notEqual name="<%= IWPSConstants.OUTPUT_BEAN %>" property="csvExportString" value="">
<script language="JavaScript" type="text/javascript">
<!--
win = window.open ("jsp/acCsvExport.jsp", "exportWin", "screenX=600,screenY=700,width=10,height=10,toolbar=no,status=no,scrollbars=no,menubar=no,resizable=no");
win.focus();
//exportWin.close();
//win.close("about:blank")
// -->
</script>
</logic:notEqual>
</logic resent>
</logic:notEqual>
</logic resent>
</logic resent>
.
.
.
################## snippet END ###################################
I used also the js function close(). WHich does the closing but also closed the dialog window for opening or saving the excel file which i reference.
Is there any solution ways I also used the class Robot from awt package but was also unsuccesfull. What i want is close only the popup window and still have available dialog window.
I appreciate your feedback
happy day
Or´┐Żun
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Controlling popup windows is a pure client-side activity, so I'm remanding this to the HTML/Javascript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
If the save dialog is on the child window then it will close.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: closing popup window after reference to jsp which's contentType is"application/excel?