CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Echo Javascript in AfterUpdate Event

Print topic Send  topic

Author Message
datadoit
Posted: 06/19/2008, 1:54 PM

CCS 3.2.0.4; PHP5

Two part question ... hoping one of them has a solution to it ...

I have a situation where I'm doing a file upload in a popup window.
After the file is uploaded, I want to refresh the window below and close
the popup window. Pretty straightforward stuff.

First, I'm finding that:

echo "<script>window.opener.location.reload();window.close();</script>";

only works on my local development Windows system (running WAMP). It
doesn't work on the production LAMP system. All versions of PHP are the
same. Does anyone know why this echo command will only work on a
Windows PHP installation versus a Linux PHP installation? Is there an
environment setting somewhere that would control this that I'm missing?

Secondly, an alternative to echoing the javascript is to use the die()
function.

Ex: die(
"<script>window.opener.location.reload();window.close();</script>");

However, can't use the die() function in this situation because I need
to call it in the form's AfterUpdate event, and the form has a
FileUpload component in it, and apparently the AfterUpdate event occurs
BEFORE the file is actually uploaded. So while the popup will do as
expected (reload the opener and close the popup), the file is never
actually uploaded.

Is there someplace other than the AfterUpdate event to use this die()
function? BTW, AfterProcessFile won't work either. Looks like the last
event in the line is the AfterUpdate event.
datadoit
Posted: 06/19/2008, 4:05 PM

I found that if I flush after echoing, all works well and people like me
better. :)

echo "<script>window.opener.location.reload();window.close();</script>";
flush();

Explanation as to why I have to flush can be found here:

http://us.php.net/flush

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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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