CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Autoclosing Popup Windows

Print topic Send  topic

Author Message
Benjamin Krajmalnik
Posted: 03/13/2007, 5:39 PM

In my applications, I often have popup windows which are called to enter
data, emulating a MDI applicatio.

The modificatio required to open these windows as a popup (as opposed to use
the "_blank" target) is very simple.

For example, I have an image link called "EditPhones".

<a href="{EditPhones}" onclick="OpenPopup(this.href);return false;"><img
src="images/edit.gif" border="0"></a>

I haveadded the following to functions.js

function OpenPopup(strRef)
{
/***
PURPOSE: Open Popup Window
IN: strRef - href of the window to open
***/

var win=window.open(strRef,"InfoPopup",
"left=50,top=50,width=800,height=600,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
win.focus();
}

Now, on the called form, I insert a label called "Autoclose" in the client
side "OnLoad" for the form, as follows:

if ({Autoclose}) {
window.opener.location.reload();window.close();
}


In the AutoClose BeforeShow event I added the following:
if (CCGetParam("Autoclose", "") == "") {
$Component->SetValue("false") ;
} else {
$Component->SetValue("true") ;
}

Now, on the OnClick Server side events of the different buttons I add:

global $FileName;
global $Redirect;

$Redirect = $FileName . "?Autoclose=1";

The onClick() client side event of the canbcel button has the following:

window.opener.location.reload();window.close();


This method should be portable to any language. In ASP I was streaming
Javascript via response.write in the afterupdate/afterinsert/afterdelete
events, but for some reason in PHP this did not work.



Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.