Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi for PHP/Library    [ Add a report in this area ]  
Report #:  126346   Status: Reported
HTML5 Builder & Downloads
Project:  HTML5 Builder Build #:  Do not know
Version:    5.0 Submitted By:   George Prins
Report Type:  Basic functionality failure Date Reported:  7/23/2014 10:36:01 AM
Severity:    Serious / Highly visible problem Last Updated: 7/28/2014 6:19:41 PM
Platform:    All versions Internal Tracking #:  
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
I have a form that has a couple of edit items on it and 3 buttons.  One of the buttons has the following code attached to download a file from the server:

    function Button5Click($sender, $params)
    {
        $file='doc.pdf';
        if (file_exists($file))
        {
           header('Content-Description: File Transfer');
           header('Content-Type: application/octet-stream');
           header('Content-Disposition: attachement; filename='.basename($file));
           header('Expires: 0');
           header('Cache-Control: must-revalidate');
           header('Pragma: public');
           header('Content-Length: ' . filesize($file));
           readfile($file);
           exit;
        }
    }

Another button has some code that is attached that goes through a list of items looking for the closest match (not that this matters, but it just demonstrates that there is other code attached to this function).

    function Button4Click($sender, $params)
    {
       $ConsigneeID="C";
       $founditem=false;
       for ($i=0; $i<$this->ListBox1->Count; $i++)
       {
          if ($ConsigneeID <= $this->ListBox1->Items[$i])
          {
             $this->ListBox1->ItemIndex=$i;
             $founditem=true;
             break;
          }
       }
       if ($founditem)
          $this->ListBox1DblClick($sender, $params);
    }

Then there is yet another button that has another function attached, but nothing really of importance.

What is happening, is that when the code attached to Button5Click is executed, after that, no matter what button you click on the code attached to Button5Click is executed.  

In essence what happens is this:

Button5     Button5Click  event
Button4     Button4Click  event
Button3     Button3Click  event

Click on Button5 (Which does the download correctly) and the following is the result after the download:

Button5     Button5Click  event
Button4     Button5Click  event
Button3     Button5Click  event

This is clearly a problem with HTML 5 Builder and I hope that someone from Embarcadero responds to this post.  If you have a work around, let me know, because this is vital
to my project.

Thanks
Steps to Reproduce:
None
Workarounds
None
Attachment
Projects.zip
Comments

Tomohiro Takahashi at 7/23/2014 7:04:36 PM -
Could you please attach sample project to reproduce/confirm your issue?

George Prins at 7/24/2014 8:20:18 AM -
Tomohiro:

I have reduce the program to the following that creates the same problem.  It just has a panel on the form with three input fields and 3 buttons.  Let me know if you need something more.

Thanks George

<?php
require_once("rpcl/rpcl.inc.php");

//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");
use_unit("abcomponents/abjqueryui/abjqueryui.inc.php");
use_unit("abcomponents/abclasses.inc.php");
use_unit("imglist.inc.php");
use_unit("dbtables.inc.php");
use_unit("db.inc.php");
use_unit("abcomponents/abdbrepeater/abdbrepeater.inc.php");
use_unit("abcomponents/abcarousel/abcarousel.inc.php");
use_unit("abcomponents/abjqgrid/abjqgrid.inc.php");
use_unit("dbctrls.inc.php");
use_unit("Zend/zpdf.inc.php");
use_unit("Zend/zfile.inc.php");


//Class definition
class Page2 extends Page
{
    public $Button5 = null;
    public $WayBillNumber = null;
    public $Panel1 = null;
    public $Label67 = null;
    public $UserName = null;
    public $Label68 = null;
    public $Password = null;
    public $Label69 = null;
    public $StationNumber = null;
    public $Button1 = null;
    public $Button4 = null;

    function Button4Click($sender, $params)
    {
       $this->UserName->Text="Inside Button4 Click";
    }
    function Button5Click($sender, $params)
    {
        $file='doc.pdf';
        if (file_exists($file))
        {
           header('Content-Description: File Transfer');
           header('Content-Type: application/octet-stream');
           header('Content-Disposition: attachement; filename='.basename($file));
           header('Expires: 0');
           header('Cache-Control: must-revalidate');
           header('Pragma: public');
           header('Content-Length: ' . filesize($file));
           readfile($file);
           exit;
        }
    }
    function Button1Click($sender, $params)
    {
       $this->UserName->Text="Inside Button1 Click";
    }
}


global $application;

global $Page2;

//Creates the form
$Page2=new Page2($application);

//Read from resource file
$Page2->loadResource(__FILE__);

//Shows the form
$Page2->show();

Tomohiro Takahashi at 7/27/2014 6:52:28 PM -
Please attach sample project(as a .zip file) to your existing report.
The standalone client(QualityCentral.exe) is availabel at this URL.
http://qc.codegear.com/qualitycentral.zip

George Prins at 7/31/2014 11:07:55 AM -
When could I expect resolution to this problem.  It is seriously holding up my project.

Thanks

Tomohiro Takahashi at 7/31/2014 6:25:44 PM -
If possible, please contact technical support service first.
http://support.embarcadero.com/

George Prins at 8/1/2014 7:27:48 AM -
Contact them for what!  I've already pointed out the problem here.  All you need to do is fix it!  Please, just fix the problem I need this for my project.

George Prins at 7/28/2014 9:29:27 AM -
I attached the project.  It is project2 in the zip file.

Thanks

George Prins at 7/25/2014 7:19:41 AM -
I see that you have a resolution status of NONE.  Does that mean you are still working on it?

Server Response from: ETNACODE01