Click to See Complete Forum and Search --> : Auto update after close child window..


eeccll
03-26-2006, 05:54 AM
I'm currently using hyperlink to direct user to a new window. Everytime the user click on the hyperlink, i will update the hits value. When the new window is closed, how to make the parent window automatic refresh with the new hits value, rather than i have to click the "Refresh" button at the Standard Buttons?? Anyone has any idea? Many thanks ^.^

sirpelidor
03-27-2006, 05:08 AM
you will need to use javascript to control the brower's behavior. This code for example, will close your current window and refresh your parent's window at the same time:


<script language="JavaScript">
<!--
function refreshParent() {
window.opener.location.href = window.opener.location.href;

if (window.opener.progressWindow)

{
window.opener.progressWindow.close()
}
window.close();
}
//-->
</script>

eeccll
03-27-2006, 07:10 AM
is it i need to have a button to close the window? For my case, i wil close the window using the 'X' at the window bar..

sirpelidor
03-27-2006, 12:39 PM
the code I showed you won't work when using the 'X' to close the window. However, maybe you can trick your application a little bit with a diff approach:

when user click on your hyperlink, refresh that window as you are open a new one. that way, counter will be added regardness how user is gonna close their new window.

If you want something very slick, you may start look into using ajax.
You will be able to change the counter value without refreshing the page.

eeccll
03-28-2006, 04:10 AM
ohh.. thanks for your suggestions.. i'll try it now..