Advanced Tooltips Support Product Page

Answered

Close window and refresh parent

Asked 26 Jun 2008 14:23:04
1
has this question
26 Jun 2008 14:23:04 Kenny Darcy posted:
Hi Yea,
I am very impressed it will have millions of uses.

Quick request thought. At present I have added a tip which pops up and has an insert behaviour added to it. The user adds some content and on submit gets taken to another page which appears inside the tooltip which says "Thank You Content added". I would like to have it so the tool tip is then closed after 2 seconds and the parent page refreshed to show the new content.

See a really quick example here
www.adminsee.com/x.asp

regards

Kenny

Promoted Answers

Replied 31 Aug 2011 11:05:32
Hello Michael,

You need to set a refresh script on a new empty page and set a redirection to it from your form page that is opened in the tooltip. Then set following in that new empty page:

...
<script language="javascript">
<!--
function refreshParent() {
if (parent.hideDmxTooltip) parent.hideDmxTooltip();
parent.parent.window.location.href = parent.parent.window.location.href;
}
function init()
{
setTimeout("refreshParent()",2000);
}
//-->
</script>
</head>
<body onload="init()">
</body>
</html>


Replies

Replied 26 Jun 2008 14:51:25
26 Jun 2008 14:51:25 George Petrov replied:
Hi Kenny,

We already have a FAQ for this:

www.dmxzone.com/showDetail.asp?TypeId=2&NewsId=15823&LinkFile=faq.htm

Just add timeout if you need a delay

Greetings,
George

--------------------------------------------------
George Petrov - Founder of the Dynamic Zones
DMXzone.com, FWzone.net, FLzone.net, CFzone.net,
DNzone.com, FlashFiles.nl
--------------------------------------------------
Replied 26 Jun 2008 15:05:55
26 Jun 2008 15:05:55 Kenny Darcy replied:
Hi yea,
I have am not very good at javascript and believe many others could make use of this script. I do not want an ok button on my page to close the pop up. the script below doesnt work if you you can see where I have gone wrong with it would be grateful.

&lt;script language="JavaScript"&gt;
&lt;!--
function refreshParent() {
window.opener.location.href = window.opener.location.href;
if (window.opener.hideDmxTooltip)
window.opener.hideDmxTooltip();
window.close();
}
function init()
{
setTimeout("refreshParent()",2000);
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="init()"&gt;

Replied 26 Jun 2008 16:06:21
26 Jun 2008 16:06:21 George Petrov replied:
Hi kenny,

I made a smaller correction it is just fine now.

george

--------------------------------------------------
George Petrov - Founder of the Dynamic Zones
DMXzone.com, FWzone.net, FLzone.net, CFzone.net,
DNzone.com, FlashFiles.nl
--------------------------------------------------
Replied 26 Jun 2008 16:15:31
26 Jun 2008 16:15:31 Kenny Darcy replied:

cheers George

re"I made a smaller correction it is just fine now."

I checked your provided earlier. what correction did you make.

regards

k
Replied 26 Jun 2008 18:26:00
26 Jun 2008 18:26:00 Kenny Darcy replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>

cheers George

re"I made a smaller correction it is just fine now."

what correction did you make.

I tried this and it didnt work

&lt;script language="JavaScript"&gt;
&lt;!--
function refreshParent() {
window.opener.location.href = window.opener.location.href;
if (window.opener.hideDmxTooltip)
window.opener.hideDmxTooltip();
window.close();
}
function init()
{
setTimeout("refreshParent()",2000);
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="init()"&gt;





regards

k
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 26 Jun 2008 20:10:38
26 Jun 2008 20:10:38 George Petrov replied:
sorry this is it

it should be:

<pre id=code><font face=courier size=2 id=code>
&lt;script language="JavaScript"&gt;
&lt;!--
function refreshParent() {
if (window.opener.hideDmxTooltip) window.opener.hideDmxTooltip();
window.opener.location.href = window.opener.location.href;
}
function init()
{
setTimeout("refreshParent()",2000);
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="init()"&gt;
</font id=code></pre id=code>

grt,
george

--------------------------------------------------
George Petrov - Founder of the Dynamic Zones
DMXzone.com, FWzone.net, FLzone.net, CFzone.net,
DNzone.com, FlashFiles.nl
--------------------------------------------------
Replied 26 Jun 2008 20:37:26
26 Jun 2008 20:37:26 Kenny Darcy replied:
Thanks George,
I tried many different ways, even your snippet and it doesnt work.

Out of interest this onclick doesnt work either

&lt;input name="closebutton" type="button" onClick="window.opener.hideDmxTooltip();" value="close"&gt;

cheers

k
Replied 27 Jun 2008 12:00:26
27 Jun 2008 12:00:26 Miroslav Zografski replied:
Hi All,

In order to have tooltip closed by its function hideDmxTooltip() you need to addres to parent:
<pre id=code><font face=courier size=2 id=code>
&lt;input name="closebutton" type="button" <b>onClick="parent.hideDmxTooltip();"</b> value="close"&gt;
</font id=code></pre id=code>

That is because the i-frame in witch the page in tooltip is opened - this function is not defined there so must be called from parent.

M.Zografski

-----------------------------------
DMXZone.com Support Team
-----------------------------------
Replied 27 Jun 2008 12:03:22
27 Jun 2008 12:03:22 George Petrov replied:
oh Sorry - seems there is documentation error it must be:

parent.hideDmxTooltip()

So you script will become:

<pre id=code><font face=courier size=2 id=code>
&lt;script language="JavaScript"&gt;
&lt;!--
function refreshParent() {
if (parent.hideDmxTooltip) parent.hideDmxTooltip();
parent.location.href = parent.location.href;
}
function init()
{
setTimeout("refreshParent()",2000);
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="init()"&gt;
</font id=code></pre id=code>

Also in the next update we will enrich the Close Advanced Tooltip behavior so it does the above as well

Greetings,
George

--------------------------------------------------
George Petrov - Founder of the Dynamic Zones
DMXzone.com, FWzone.net, FLzone.net, CFzone.net,
DNzone.com, FlashFiles.nl
--------------------------------------------------
Replied 27 Jun 2008 15:13:33
27 Jun 2008 15:13:33 Kenny Darcy replied:
It works brilliant,

thanks all

k
Replied 08 Jul 2008 09:15:06
08 Jul 2008 09:15:06 Neo 314 replied:
Hi,

Definitely an error in the documentation regarding window.opener vs parent. I also noted that the hide function does not provide the exit fade or other effect.

I'm not trying to refresh the parent page, but I noticed in the example of a form in the tooltip, that any information in the form is lost if the tip closes and is reopened.

Instead I set the tip to never close and added a cancel button to the form and a close button after submitting the form. It would be nice if I could get the fade out effect on a javascript call to close the window.

Is there an API available?

Steven

Edited by - neo314 on 08 Jul 2008 09:17:02
Replied 08 Jul 2008 10:24:40
08 Jul 2008 10:24:40 Miroslav Zografski replied:
Hi Neo,

No, there is no API avaliable on that, as the onclose effects are not added.

Regards,

M.Zografski

-----------------------------------
DMXZone.com Support Team
-----------------------------------
Replied 30 Aug 2011 12:51:19
30 Aug 2011 12:51:19 Michael Bullard replied:
Hi, I've looked at this and cannot figure out how to apply it to my pages. I have a parent page which calls a popup with a form that updates the info on the parent page.
Presently, I use the "hideDmxTooltip" function to close the popup when I submit the form. I use PHP to identify the correct record, as in page.php?id_usr=<?php echo $row_rsUserInfo['id_usr']; ?>.
What code do I apply and to which page - popup or parent? And where do I add the code?
You help will be much appreciated,
Michael
Replied 31 Aug 2011 11:05:32
31 Aug 2011 11:05:32 Miroslav Zografski replied:
Hello Michael,

You need to set a refresh script on a new empty page and set a redirection to it from your form page that is opened in the tooltip. Then set following in that new empty page:

...
<script language="javascript">
<!--
function refreshParent() {
if (parent.hideDmxTooltip) parent.hideDmxTooltip();
parent.parent.window.location.href = parent.parent.window.location.href;
}
function init()
{
setTimeout("refreshParent()",2000);
}
//-->
</script>
</head>
<body onload="init()">
</body>
</html>


Reply to this topic