467,161 Members | 991 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,161 developers. It's quick & easy.

Parent Window Reload

I'm facing a tricky (at least for me) page reload/refresh scenario and
need some help.

I'm working on a web application which is primarily used with MSIE. The
application has a main window with an i-frame in it. The i-frame
contains various dynamic links for opening data entry popups. One of
these popups has a couple of i-frames itself. These i-frames also have
links to scripts which make changes to a server side database.

I need for the main application window to reload (refresh) when a
script is run in one of the i-frames of the popup data entry window
(changes are made to the database). So far I've been able to reload the
i-frame in the main application window but not the main window itself.

I would prefer not to use specific window/frame names but to use
relative properties like parent, top, frame[1] etc.

Any help would be appreciated.

Thanks,
Raffi

Jan 17 '07 #1
  • viewed: 24120
Share:
7 Replies
ASM
Raffi a écrit :
I need for the main application window to reload (refresh) when a
script is run in one of the i-frames of the popup data entry window

I would prefer not to use specific window/frame names but to use
relative properties like parent, top, frame[1] etc.
The mother of your popup is 'opener'
The mother of your iframe in the popup is 'parent'

so, from iframe in the popup :

parent.opener.location.reload();

from iframe in iframe of popup :
top.opener.location.reload();

Take care that probably the main window after refresh will forget its
daughter (the popup will no more exist for her)
so the popup will have to close itself.
However the popup continues to know its opener window and will yet be
able to sent informations to the new reloaded file.
(i.e. to feed text fields of form in main window)
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 18 '07 #2

ASM wrote:
Raffi a écrit :
I need for the main application window to reload (refresh) when a
script is run in one of the i-frames of the popup data entry window

I would prefer not to use specific window/frame names but to use
relative properties like parent, top, frame[1] etc.

The mother of your popup is 'opener'
The mother of your iframe in the popup is 'parent'

so, from iframe in the popup :

parent.opener.location.reload();

from iframe in iframe of popup :
top.opener.location.reload();

Take care that probably the main window after refresh will forget its
daughter (the popup will no more exist for her)
so the popup will have to close itself.
However the popup continues to know its opener window and will yet be
able to sent informations to the new reloaded file.
(i.e. to feed text fields of form in main window)
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Thanks for your suggestions. Unfortunately both of these are only
refreshing the i-frame in the main window, not the main window itself.

Any other suggestions are welcome.

Thanks,
Raffi

Jan 18 '07 #3
ASM
Raffi a écrit :
ASM wrote:
>so, from iframe in the popup :

parent.opener.location.reload();

from iframe in iframe of popup :
top.opener.location.reload();
Thanks for your suggestions. Unfortunately both of these are only
refreshing the i-frame in the main window, not the main window itself.

Any other suggestions are welcome.
put your code on line
that we could understand your application

http://stephane.moriaux.perso.wanado...uc/tutticanti/
works fine for me

reloading a page via 'location.reload()'
won't reset forms of this page

to get an reseted page : location = location;

see the both examples in the iframe of my popup

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 18 '07 #4
ASM wrote:
Raffi a écrit :
ASM wrote:
so, from iframe in the popup :

parent.opener.location.reload();

from iframe in iframe of popup :
top.opener.location.reload();

Thanks for your suggestions. Unfortunately both of these are only
refreshing the i-frame in the main window, not the main window itself.

Any other suggestions are welcome.

put your code on line
that we could understand your application

http://stephane.moriaux.perso.wanado...uc/tutticanti/
works fine for me

reloading a page via 'location.reload()'
won't reset forms of this page

to get an reseted page : location = location;

see the both examples in the iframe of my popup

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Thanks for the reply and the example. This example works for me too.
However, in the application, the main page (Mother) is also in an
i-frame. In your example the main page does not have an i-frame. When I
put an i-frame in the main page of your example, the reload link only
refreshes the i-frame, not the main window.

Raffi

Jan 19 '07 #5
ASM
Raffi a écrit :
>
Thanks for the reply and the example. This example works for me too.
However, in the application, the main page (Mother) is also in an
i-frame. In your example the main page does not have an i-frame. When I
put an i-frame in the main page of your example, the reload link only
refreshes the i-frame, not the main window.
I think you're wrong.
Nothing in code of 'tutticanti' can reload only Mother's iframe.

You have :
- a first link to reload the mother's file (no forms reset)
- a second link to re-open/re-download mother's file
(forms, iframe, etc, reseted)

With iframe in mother's file it is OK too
http://stephane.moriaux.perso.wanado...uc/tutticanti/

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 19 '07 #6

ASM wrote:
Raffi a écrit :

Thanks for the reply and the example. This example works for me too.
However, in the application, the main page (Mother) is also in an
i-frame. In your example the main page does not have an i-frame. When I
put an i-frame in the main page of your example, the reload link only
refreshes the i-frame, not the main window.

I think you're wrong.
Nothing in code of 'tutticanti' can reload only Mother's iframe.

You have :
- a first link to reload the mother's file (no forms reset)
- a second link to re-open/re-download mother's file
(forms, iframe, etc, reseted)

With iframe in mother's file it is OK too
http://stephane.moriaux.perso.wanado...uc/tutticanti/

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Try putting the link (and javascript function) to open the popup inside
the i-frame of the parent window. This will result in the i-frame being
refreshed but not the main window itself.

Raffi

Jan 19 '07 #7
ASM
Raffi a écrit :
ASM wrote:
>>
With iframe in mother's file it is OK too
http://stephane.moriaux.perso.wanado...uc/tutticanti/

Try putting the link (and javascript function) to open the popup inside
the i-frame of the parent window. This will result in the i-frame being
refreshed but not the main window itself.
Give an url of your work to see what you mean.

Of course if you use directly JS from main page in one of its daughters
(iframe or popup) that will not work without adaptations ... :-(

With last example, I think you have all what is necessary.
You only have to play with truc, opener, parent, iframes names, document
and forms, combining them to do the expected job.
Read and understand how JS calls are built in 'frame.htm' and 'essai.htm'

Put JS functions in main page.
To call function motherFunction(arguments)
- From 'father' : parent.motherFunction(arguments);
- From popup : opener.motherFunction(arguments);
- From iframe in popup : parent.opener.motherFunction(arguments);
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 19 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Winfried Koenig | last post: by
10 posts views Thread by Marshall Dudley | last post: by
3 posts views Thread by Joe | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.