Parent Window Reload

R

Raffi

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
 
A

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)
 
R

Raffi

ASM said:
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)

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
 
A

ASM

Raffi a écrit :
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.wanadoo.fr/truc/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
 
R

Raffi

ASM said:
Raffi a écrit :

put your code on line
that we could understand your application

http://stephane.moriaux.perso.wanadoo.fr/truc/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

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
 
A

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.wanadoo.fr/truc/tutticanti/
 
R

Raffi

ASM said:
Raffi a écrit :

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.wanadoo.fr/truc/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.

Raffi
 
A

ASM

Raffi a écrit :
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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top