469,632 Members | 1,649 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Refreshing parent window from modal window?

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
3 8894
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
gsuns82
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
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.

Similar topics

1 post views Thread by amith | last post: by
1 post views Thread by stellabein | last post: by
6 posts views Thread by Mike | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.