• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

window.opener problem

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 don't even know how to spell CIA. But this tiny ad does:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic