• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

window.opener problem

 
shiva sarna
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic