aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes window.opener problem 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 "window.opener problem" Watch "window.opener problem" New topic
Author

window.opener problem

shiva sarna
Greenhorn

Joined: Jul 23, 2006
Posts: 23
Hi,

I am working on struts but needs to write a javascript function on my jsp.


My present jsp (which is a pop up)is called by nextMonth.do action class.

On hitting the close button I am supposed to send the user to Scheduler1.do action class and reload the parent page.

The fuction goes like this:

function xyz()
{
window.location="Scheduler1.do";
window.opener.location.reload(true);
window.close();
}

Though this does close the child window BUT it reloads the page using nextMonth.do class and not Scheduler1.do class.

Please tell me if there is any way by which I can reset window.opener so that the parent window is reloaded using Scheduler1.do and not nextMonth.do
action class.

Thanks in advance for yr help.

regards

shiva


SCJP 5.0
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You should be setting the url of the parent not the child

window.opener.location.href = "Sc....";

Don't do the reload()

Eric
shiva sarna
Greenhorn

Joined: Jul 23, 2006
Posts: 23
Thanks Eric for your reply..will check this out on Monday and let you know. I just hope the page reloads without calling the reload() function as I want the new data to appear on the page.

thanks a lot...will let you know if it worked.
shiva sarna
Greenhorn

Joined: Jul 23, 2006
Posts: 23
Hi Eric,

It did work but the page is getting refreshed only once.

My module is like a calendar where the user can add events for the dates as soon as he adds the events(The add window is a pop up window) I want the calendar to get refereshed showing the events beside the selected date.

I did do window.opener.location.href="Scheduler1.do";

but it refereshes the page only once and next time it just closes the pop window without refereshing the page.


I think I need to reset window.opener.location.href every time I open the add window but I don't know how to do it.

Please help me how to go ahead with this.

thanks for your help

regards

shiva
 
wood burning stoves
 
subject: window.opener problem