943,724 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 9418
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Jul 3rd, 2008
0

Close Pop up window when cancel on dialog box is pressed

Expand Post »
Hello

I have a jsp on which there is a table and a hyperlink to Export the same table into excel sheet. According to the functionality, it is required that on clicking Export, a blank pop up without address bar and other toolbars will be opened and on that empty pop up, the dialog box for Open, Save or Cancel Excel file will come.

Now, if the user clicks on open, the excel file opens in the pop up. But if user clicks on either save or cancel, in the both cases, the blank pop up remains opened. Please suggest the ways to close it automatically when save or cancel is clicked.

Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
adityam4444 is offline Offline
10 posts
since Feb 2008
Jul 11th, 2008
0

Re: Close Pop up window when cancel on dialog box is pressed

Can't u just use dispose() or hide() methods of Popup ??
Reputation Points: 10
Solved Threads: 0
Newbie Poster
diasmvds is offline Offline
9 posts
since Jun 2008
Jul 17th, 2008
0

Re: Close Pop up window when cancel on dialog box is pressed

Try combining dispose() or exit() with the window...you could also pass a variable false to set the pop-ups visibility.

What is your code? You could also set your pop-up as listener for an close event. Did you try that one too?
Last edited by loken; Jul 17th, 2008 at 5:02 am. Reason: additional information
Reputation Points: 10
Solved Threads: 0
Light Poster
loken is offline Offline
29 posts
since Jul 2008
Jul 25th, 2008
0

Re: Close Pop up window when cancel on dialog box is pressed

Click to Expand / Collapse  Quote originally posted by loken ...
Try combining dispose() or exit() with the window...you could also pass a variable false to set the pop-ups visibility.

What is your code? You could also set your pop-up as listener for an close event. Did you try that one too?
I do not have any BODY in the pop up because the page that is going to be loaded on that pop up is in excel format. Therefore I don't know where to place the code to close unused pop up.

If the user clicks on Open, then only the jsp will be loaded in the excel format on that pop up, else in case of Save and Cancel, the pop up will remain without Body. That is why I could not provide any code for that.

I want to know, can something be done in the opener of that pop up?

Same problem was present in Google Analytics, but here on clicking on Export, a new Browser window is opened, not any pop up.

Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
adityam4444 is offline Offline
10 posts
since Feb 2008
Jul 31st, 2008
0

Re: Close Pop up window when cancel on dialog box is pressed

you usually place disposer() and flush() codes on events such as windowclose,windowopen and etc....

if you wish to open a popup when you click on export, you can simply call yourpopupid.open() method...
or is that what you intend to do?
Reputation Points: 10
Solved Threads: 0
Light Poster
loken is offline Offline
29 posts
since Jul 2008
Jul 31st, 2008
0

Re: Close Pop up window when cancel on dialog box is pressed

similarly you can call the dispose() or flush() or even setVisible(false) method on the click event for the cancel button. that way the popup should close.
Reputation Points: 10
Solved Threads: 0
Light Poster
loken is offline Offline
29 posts
since Jul 2008
Aug 6th, 2008
0

Re: Close Pop up window when cancel on dialog box is pressed

Click to Expand / Collapse  Quote originally posted by loken ...
similarly you can call the dispose() or flush() or even setVisible(false) method on the click event for the cancel button. that way the popup should close.
My Dear Loken, those Cancel, Save and Open buttons are of windows dialog box, not of any which I am creating.

Let me explain. Assume X.jsp is a page on which a link Export is present. On clickicking it, a new Pop up is opened which DOES NOT have any body. A new page called Y.jsp will be loaded on this pop up in Excel Format. In Y.jsp I am using contentType="application/vnd.ms-excel; charset=UTF-8" in Y.jsp, that is why I cannot place any javascript code on Y.jsp.

I have attached the view of Dialog Box. If Open is pressed, Y.jsp will be loaded on EMPTY pop up, else, the pop up will be there without any body.
Attached Images
File Type: bmp DialogBox.bmp (342.1 KB, 116 views)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
adityam4444 is offline Offline
10 posts
since Feb 2008
Aug 6th, 2008
0

Re: Close Pop up window when cancel on dialog box is pressed

ok, seems I must have misunderstood you...sorry about that...

this is how I would normally handle closing..
method onCancel
{
this.setVsible(false);
this.dispose();
}

I haven't check it with this sort of pop-ups so I might have to check more about this...I'll update you with my output...
Reputation Points: 10
Solved Threads: 0
Light Poster
loken is offline Offline
29 posts
since Jul 2008
Aug 9th, 2008
0

Re: Close Pop up window when cancel on dialog box is pressed

Click to Expand / Collapse  Quote originally posted by loken ...
ok, seems I must have misunderstood you...sorry about that...

this is how I would normally handle closing..
method onCancel
{
this.setVsible(false);
this.dispose();
}

I haven't check it with this sort of pop-ups so I might have to check more about this...I'll update you with my output...
Thanks Loken, I will try this code. But I have confusions.
- Do have to place this code snippet in the JSP which will be loaded as excel file?
- Does this onCancel function needs any input parameters? Because how onCancel() will know that Cancel or Save is pressed?
- Javascript function in an excel file... Believe me.... I am surprised.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
adityam4444 is offline Offline
10 posts
since Feb 2008
Aug 11th, 2008
0

Re: Close Pop up window when cancel on dialog box is pressed

Hi Loken

Sorry to say, that method onCancel didnt work. We have to think more on that.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
adityam4444 is offline Offline
10 posts
since Feb 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: i need urgent help. this error cmoing. i dont know what to do
Next Thread in Java Forum Timeline: JDBC, MySQL





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC