File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Problem with pop-up 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 "Problem with pop-up" Watch "Problem with pop-up" New topic
Author

Problem with pop-up

Anand Jayaraman
Ranch Hand

Joined: Jan 28, 2004
Posts: 104
Hi Guys!


I have a problem and I hope someone can help me out here. It goes like this:

I have a page. This page has links which opens up a pop-up window. This pop-up window has a Save button which will do some operation for the user. Once the Save button is clicked, the pop-up will close. Now, I want the parent page (the page which had my links) to reload automatically once the pop-up is closed.

How do I do it?

What I have been doing is::

-- have a function like this:




Thanks.......
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
this should do it I think...

window.opener.reload();

or simply

window.opener.location.replace=window.opener.location.href;

Eric
Anand Jayaraman
Ranch Hand

Joined: Jan 28, 2004
Posts: 104
Hi Eric!

I guess you've got me wrong here. When I cause the pop-up window to close, I must force the parent page to reload. And thus, in the pop-up window, I have included that code.

I tried windo.location.reload(), but what it does is, it reloads the pop-up window before closing it.


Cheers
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The first time I looked at your code I did not see the main problem. You are closing the window before you call the reload function. You must call the reload function, then close the pop up window. If you close the window then the reload statement will not be called.

This should do it...
window.opener.reload();
window.close();

Eric
Anand Jayaraman
Ranch Hand

Joined: Jan 28, 2004
Posts: 104
Hi Eric!

Thanks for that!!! It worked..... Good on you, mate!


Cheers
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You are lucky I am up working on my book and not sleeping!

glad it worked....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with pop-up