Problem: JSP does not restore after downloading Excel.

I have a "search.jsp" with a commandButton to generate excel. "Report.jsp" opens up in a new window when i click on this button by running below mentioned javascript. I can download Excel successfully by clicking on Download Excel link in report,jsp. Problem is, once i close this new window, I am unable to perform any other action in "search.jsp" even if i do not perform download. If i click on any other button or link "search.jsp", it replaces whole jsp with the Downlaod Excel link. and nothing happens after that . i need to close the seesion and start all over again from login page. Does anyone has solution. It will be big help. Thanks.
JAVASCRIPT:
function aaaa()
     mywindow =window.open('report.jsf', 'popupWindow', 'width=400,height=200,left=0,top=100,screenX=0,screenY=100');
Following is report.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://www.backbase.com/2007/jsf" prefix="bjsf" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<f:view>
<h:form>          
<h:commandLink actionListener="#{searchpage.export}" value="Download Excel" />
cancel
</h:form>               
</f:view>
</body>
</html>
Following is export function which runs when i click on above commandlink "Download Excel":
     public void export(ActionEvent event) {
          try {
               FacesContext context = FacesContext.getCurrentInstance();
               HttpServletResponse response = (HttpServletResponse) context
                         .getExternalContext().getResponse();
               response.setContentType("application/vnd.ms-excel");
               response.setHeader("Content-Disposition",
                         "attachment; filename=report.xls");
               ServletOutputStream servletOutputStream = response
                         .getOutputStream();
               WritableWorkbook workbook = Workbook
                         .createWorkbook(servletOutputStream);
               WritableSheet sheet = workbook.createSheet("First Sheet", 0);
               WritableFont lfont = new WritableFont(WritableFont.ARIAL, 10);
               lfont.setBoldStyle(WritableFont.BOLD);
               WritableCellFormat lformat = new WritableCellFormat(lfont);
               lformat.setBackground(Colour.DARK_RED2);
               lformat.setBorder(Border.ALL, BorderLineStyle.THICK);
               WritableFont rfont = new WritableFont(WritableFont.ARIAL, 10);
               WritableCellFormat rformat = new WritableCellFormat(rfont);
               rformat.setBorder(Border.ALL, BorderLineStyle.THIN);
               for (int i = 0; i < this.list.size(); i++) {
                    HashMap h = (HashMap) this.list.get(i);
                    if (i == 0) {
                         Set s = (Set) h.keySet();
                         Iterator itr = s.iterator();
                         int j = 1;
                         while (itr.hasNext()) {
                              Label label2 = new Label(j, 1, itr.next().toString(),
                                        lformat);
                              sheet.addCell(label2);
                              j++;
                    Collection c = h.values();
                    Iterator itr = c.iterator();
                    int j = 1;
                    while (itr.hasNext()) {
                         Label label2 = new Label(j, (i + 2), itr.next().toString(),
                                   rformat);
                         sheet.addCell(label2);
                         j++;
               workbook.write();
               workbook.close();
               context.responseComplete();
          } catch (Exception e) {
               e.printStackTrace();
     }

Try upgrading JSF. I recall a Javascript-specific bug like this in a specific webbrowser. You could try to test in different webbrowsers. The latest JSF 1.2 is currently 1.2_14 which came out just 3 weeks ago. You can get it at [http://javaserverfaces.dev.java.net].
Oh, you certainly need to invoke `FacesContext#responseComplete()` afterwards. This is really not the problem.

Similar Messages

  • Rented movie does not play after download if not connected to the internet

    rented movie does not play after download if not connected to the internet

    Hello b noir.
    Thank you for your interest in solving my problem.
    What I did I opened iTune. I read the information about what does my computener need to play back a rented movie. My computer is okay to play back rental movies. So I went to the iTunes store, I searched for the movie I want to watch, i singned in into my Mac account and I bought the movie. The movie started to download to my computer, it took some time because I bought a HD version, but it never stop and after a couple of hours or little less the movie was in the Rented folder of my iTunes and also I checked to be sure that was in the movie folder. So, next day I open iTunes and click on the movie, it opens but I wait for five minuetes and never started to play back, so I tried several time and I looked for info in different internet forums but I couldn't find anything that help. So I posted the problem in this forum and also I called Apple. Apple contacted me and they let me to download the movie again. So I did it and now I will watch the movie later. Not sure if the movie will play back normally or if I am going to have the same problem. I'll keep you posted.
    Apple representative did not know why this happened.
    Thanks.

  • Google Chromecast does not work after downloading Blackberry Link

    Google Chromecast does not work after downloading Blackberry Link.
    Both don't work in tandom at the same time.
    Some elements of Blackberry Link are interferring with Google Chromecast's detection and casting.
    Please rectify the problem.

    Yes they are not compatible. I do not have either program so could not try anything.
    Try running one in a different compatibility mode. 

  • EXE DOES NOT START AFTER DOWNLOADING

    I downloaded lr 4.3 but double clicking it does not open the exe. When I double click older lr downloads they still open normally.Right clicking and open does not work either. What to do?

    Windows Vista Home Premium 6.0.6002 SP2 Build 6002, Intel Core 2 Quad
    Q9300 2.5GHz. When I double click the download, the arrow starts rotaing
    for about 30 seconds and then disappears without any new window opening
    Op 17/12/2012 23:55, Jeff A Wright schreef:
    >
          Re: EXE DOES NOT START AFTER DOWNLOADING
    created by Jeff A Wright
    <http://forums.adobe.com/people/JeffAWright> in /Downloading,
    Installing, Setting Up/ - View the full discussion
    <http://forums.adobe.com/message/4928607#4928607

  • Script does not work after download

    Hi,
       I have build a form in SAP enviornment using Adobe Life Cycle designer, while designing I have been using XML datasource and wrote scripts for different events on the elements of the form, the script works perfectly fine while designing, but fails when downloaded through an application. I downloaded form and to check if the scripts are still there or not, the script was present, but would not simply execute, for ex. while on clicking of button, certain fields on the form are to be hidden, but this would not work.
    ex. this.parent.parent.StaticText39.presence
    = "hidden";this.parent.parent.STELL_STEXT.presence
    = "hidden";
    The above scripts work perfect durong designing the form, but would not work after form is downloaded through an applciation. Could any one have answer to wierd behaviour?
    Regards,
    Shishir.P

    Was the form saved as a dynamic XML form?
    While the default preview in LiveCycle Designer may be set to dynamic XML form, thus providing the dynamic behaviour you are seeking, if the form is not saved as a dynamic XML form Adobe Reader and Acrobat will not respect the changes to the presence property at run-time.
    Steve

  • Pages does not open after downloading an upgrade

    I have downloaded an upgrade several days ago and since than the application does not work or open at all.

    System Reset...
    Hold down the on/off switch and the Home button simultaneously until you see the Apple logo. Ignore the text "Slide to power off" if it appears.
    A Reset does not delete apps, music, movies, photos or any other data.

  • Firefox 8 upgrade file does not start after downloading it.

    I am using Firefox 3.0.19. I tried to download the .exe for firefox 8 in order to upgrade, but when I start the exe, the only window that pops up is asking if I want to run the upgrade under this user or another. When selecting my user (I have admin rights), the window closes and nothing happens.
    Do I first need to uninstall Firefox 3 ?
    And also, will my bookmarks be kept when upgrading (of course without first uninstalling ff 3). Or which file should I backup and where should I place it back?

    Do a clean (re)install and delete the Firefox program folder (C:\Program Files\Mozilla Firefox\).
    Download a fresh Firefox copy and save the file to the desktop.
    * Firefox 8.0.x: http://www.mozilla.com/en-US/firefox/all.html
    Uninstall your current Firefox version if possible.
    *Do NOT remove personal data when you uninstall the current version or you lose your bookmarks and other data in the profile folder.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    *It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    You may have to start the installer as administrator via the right-click context menu: Run as Administrator
    Your bookmarks and other profile data are stored elsewhere in the Firefox Profile Folder and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Profile_backup
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • Web does not work after downloading Opera Mobile

    For two months now, my phone has been working perfectly, but three days ago, after I'd downloaded Opera Mobile, I'm not able to use the Web app on my phone. In fact, I can't open the Nokia Store or the Ovi Music Store using my home Wi-Fi connection. As a result, I can't even check for updates on my phone by going to Settings>Applications>Manage Applications. Opera Mobile works perfectly using the same connection though. Can anybody help?
    Solved!
    Go to Solution.

    have you tried to delete Opera Mobile to see if it reverses everything?

  • Update 7.1.2 does not install after downloading for around an hour.  Wifi on, back up done, have space for update, turned off and on once completed but still doesn't seem to want to install. Help!

    UPdate to 7.1.2 not installing

    iPad: Unable to update or restore
    http://support.apple.com/kb/ht4097
    iTunes: Specific update-and-restore error messages and advanced troubleshooting
    http://support.apple.com/kb/TS3694
    If you can’t update or restore your iOS device
    http://support.apple.com/kb/ht1808
    iPad Stuck in Recovery Mode after Update
    http://www.transfer-iphone-recovery.com/ipad-stuck-in-recovery-mode-after-update .html
    iOS: Apple logo with progress bar after updating or restoring from backup
    http://support.apple.com/kb/TS3681
     Cheers, Tom

  • Firefox does not update after downloading updates on restart. How to fix?

    For quite some time now I receive the auto-notification that an update is ready to download. I proceed with the download and restart Firefox, yet the browser never updates. How do I fix this short of doing manual downloads every time?
    MacBook Pro Mac OS 10.6 FF v 10.0

    Thanks for your reply, Matt. I already read the knowledge base article, and it doesn't specifically address my issue. The update IS being downloaded, yet it is not updating the FF app - even on restart. As I indicated in my initial question, I've been experiencing this for the last year. To finally upgrade to v.10.0 I had to download a fresh copy of FF. Now, again, for the last two updates that I've been notified on - 10.1 and 10.2 I've followed the same procedure - allowed the downloads, did the restart and NO UPDATE to the app.

  • Firefox does not install after downloading

    I am trying to install Firefox on my laptop. I clicked download from the Mozilla website and it downloaded properly but when I click "run" it does nothing.

    Hello dnicolosi, try from : http://www.mozilla.org/en-US/firefox/all/
    see also : https://support.mozilla.org/en-US/kb/how-download-and-install-firefox-windows
    thank you

  • Acrobat XI does not run after downloading

    Program just hangs when printing to PDF or creating pdf - error message - "acrobat failed to send DDE message"?

    Without system info nobody can know. Generelly this error means that something on your system is blocking communication between the programs, so check your virus scanner and so on.
    Mylenium

  • After restoring definitions iphone 3gs does not works, after restoring definitions iphone 3gs does not works

    after restoring definitions iphone 3gs does not works

    What do you mean by "restoring definitions"?
    What EXACTLY is your problem?
    "does not works" is just a bit vague.

  • Wi-Fi does not work after 7 ISO download for iPhone 4s  What is the solution

    Wi-Fi does not work after 7 ISO download for iPhone 4s
    What is the solution

    For clarification, 7 ISO is not an Apple software product
    iOS 7 is...
    What is your issue with the wifi?
    Have you reset network settings?
    Can you include screenshots of the issue?

  • My camera does not work after I restored the system, how can I use it again?

    My camera does not work after I restored the system, how can I use it again?
    Thank you for your help!

    Did try to restore "as new device" without using the backup after that?
    Did you try to reset the phone by holding the sleep and home button until the Apple logo coes back again?

Maybe you are looking for

  • HT1237 BootCamp/Vista problems

    I installed Windows Vista on my macbook via bootcamp. The install went well or so i thought. Now that windows is installed, the computer does not see any wireless networks or when plugged into the router the internet. I also do not see how I switch b

  • 2 Keynote chart questions

    I'm trying to build a series of 14 different data charts in Keynote. I'm having problems creating two... Chart 1 (Line-format): This is for "Average Time" spent on a helpdesk call. For the Y-axis, I can't figure out a way to input data in a Minute:Se

  • Fox and Geese Question

    Hello, I am creating a fox and geese game using a normal checkerboard. The checkerboard is a .txt file and I am implementing five methods. I am having problems verifying that the geese can move. It is probably a semantics error. I was hoping if someo

  • Help with Deque, insertRight() removeLeft() Methods in particular

    Hello, I am attempting to implement a deque, I have working insert left and remove right methods as a normal queue works. ---> However I am having trouble implementing my insert right and remove left methods... keep hitting an array out of bounds pro

  • IPhone X Wi-Fi

    Hey guys, I'm new here. I'm having problems to connect my iPhone to my Wi-Fi connection at home. My iPhone cant find any network and when I try "Choose a Network" set Name, Security and Password this message appears: "Could not find the network". It