473,222 Members | 1,723 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,222 software developers and data experts.

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 9133
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

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

Similar topics

5
by: Lee | last post by:
I am using a modal window and an iFrame to try and pull a return value back. I am doing this across domains. I have the value returned from the modal window to the iFrame window but I can not...
1
by: amith | last post by:
Hi, I have a javascript, calendar.js which i use to enable my client to select the date. This calendar pops up on the click of a gif image. But the problem is that this poped up window is not...
1
by: gopal srinivasan | last post by:
I need to know how to close a parent modal window when child modal window opens, also i need to know the syntax for writing document on the modal window on the fly, like what we do in case of...
1
by: stellabein | last post by:
Hi friends, I am very very new to programing. i have a one main window from that window i am opening one modal window using showmodaldialog(m.jp...). in that modal window i have a form. when i...
4
by: Sileesh | last post by:
Hi I have a btn in Parent.aspx page . On server_click() of the Btn, i am opening a new window called the child.apsx window. Child window also have a Btn. On serverClick of this Btn, I perform...
6
by: Mike | last post by:
i have a button that opens a modal window which has the calender control in it. I allow the user to select a date then that date should be passed back to the parent form. I'm having an issue with...
1
by: WLF | last post by:
I have the following function (C# behind aspx page): private void ButtonNewSupplier_Click(object sender, System.EventArgs e) { Response.Write("<script...
2
by: Robert Degen | last post by:
Hello, I got a little problem. Seems very simple: * I want to open a popup window * Popup-window uses data from its father window. BUT a parent.window does NOT point to the real parents...
1
Wolfling
by: Wolfling | last post by:
I have a VB6 MDI Application with a few MDI child windows always open. When the application opens a modeless non-MDI child window, and that child opens a Modal window (eg common dialog FileOpen...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.