Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Refresh the previous page

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am using struts for my web application. I have 2 jsp pages suppose: pageA, pageB. I click a button "Add" on pageA and this opens pageB. On pageB when I click of "Accept" it closes pageB but at the same time I want to refresh pageA. How do I incorporate this behaviour in struts or in javascript is also ok?

Please let me know, thanks for your time in advance.

Luke.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried google yet? Do a search on "javascript parent child windows", or something similar, it should bring back lots of links of good examples.
[ January 31, 2006: Message edited by: alan wamser ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to use javaScript to do this.

If you used the window.open() method from pageA to open pageB, you can reference pageA from pageB using the opener property of the window object.

So, just before closing, pageB could execute the following javascript:

window.opener.document.myForm.action = "refreshPageA.do";
window.opener.document.myForm.submit();

to refresh pageA.
 
Luke Zechariah
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alan and Merrill thank you very much for the suggestions. It works!

Have a blessed time.

Luke.
 
Luke Zechariah
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if I have 3 pages PageA, PageB, PageC: PageA opens pageB, pageB opens pageC. When I click submit on PageC I want refresh PageA.

Thanks for your time in advance.

Lk.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic