By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 2,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

Refreshing parent window from modal window?

P: 58
Hi all,
I am using modal window for some update purpose,
the issue i am facing is,i am not able to refresh parent after closing
modal window.

The code i used:
------------------------

For opening modal window from parent window:
Expand|Select|Wrap|Line Numbers
  1. showModalDialog("mypage.jsp",window,"dialogHeight:480px;dialogWidth:700px;");
  2.  
For closing modal and refreshing parent the following code is used:

Expand|Select|Wrap|Line Numbers
  1.         window.close();
  2.         var xWin = window.dialogArguments;
  3.     xWin.location.reload(true);
  4.  
The above code is inconsistent in refreshing parent,if i refresh parent for more than 2 or 3 times its not showing the latest value instead it shows the value from browser cache,

i am also using the following code in parent page to avoid cache store

[HTML]<meta http-equiv="cache-control" content="text/html; charset=iso-8859-1, no-cache, no-store, must-revalidate" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
[/HTML]
can any one tell me how to over come this issue?

regards,
sundar
Oct 30 '08 #1
Share this Question
Share on Google+
3 Replies


P: 93
Hi friend
can you please tell me what is gettijng done by window.dialogArgument.

As I can see in the above line you have close the Modal window and then tried to refresh the parent page.Which is not true.As as soon the Modal window is closed the function can not trace th parent of this window.

Now do one thing instead of closing at the first close it in the last of the code
and it is always safe to use top.close instead of window.close.

Hope this will resolve your problem.
Oct 30 '08 #2

P: 58
Hi friend
can you please tell me what is gettijng done by window.dialogArgument.

As I can see in the above line you have close the Modal window and then tried to refresh the parent page.Which is not true.As as soon the Modal window is closed the function can not trace th parent of this window.

Now do one thing instead of closing at the first close it in the last of the code
and it is always safe to use top.close instead of window.close.

Hope this will resolve your problem.
Hi friend,
window.dialogArgument returns the reference of parent window,
the problem i face is parent window gets refreshed before the server side code gets executed,so the latest value is not reflected when i use javascript parent window refresh.....


how to fix this?


regards,
sundar
Oct 30 '08 #3

P: 93
I had mentioned solution to this problem in the previous post.Please read that carefully.You are refreshing the parent later and closing the modal first .Do the reverse of it.First refresh the parent then at last write top.close this will work fine.
Oct 31 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.