• 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

close child Window and reload parent window

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

i have a parent window where a button is pressed to create a child window. In the child window i can edit and save the record. Now when i press the "Close" button(in the Child Window), i want to close the child Window and reload the parent window so it can show the latest changes.

i tried :
parent.document.location.reload();
window.close();

but it does not seem to work.

Any Suggestions


Thanks

Anil
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
define a function in the parent window called close child or some such, close the child then call reload on self. Hope this helps
 
AnilPrakash Raju
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.

But i tried something else in the child window:

opener.location = "http://name.com";
opener.focus();
self.close();

and it works.

But thanks for your solution


 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I saw that issue in couple cases. From my point of view, you have to have a delay between calling reload and close, something like



My filling is that window gets closed to fast, so reload does not get a chance to start.
 
Our first order of business must be this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic