Icon View Incident Report

Serious Serious
Reported By: Michael Dreher
Reported On: 9/14/2016
For: Version 2.05 Build 4
# 4461 Closing a Modal Form in Internet Explorer Can Cause a Stack Overflow at Runtime

Last week I had to recompile a Webbuilder projekt in version 2.05, that was compiled before with version 2.04. After recompiling there is a problem with a modal form call and the internet explorer (and so observable in der Webbuilder IDE), while in the firefox is works fine as before.

The code is as follows.

The effect in the IE:
After the close command in the modal form, for about one second nothing happens. Than the modal form becomes invisible and the caller form remains grayed. The ShowMessage message in the OnClose handler is never shown. Effectively the modal state remains.

The IE about box says version: 11.0.9600.18427.

// handle button click to call a modal form
procedure TfmMain.btnEnterDMCClick(Sender: TObject);
begin
 EnableSearchButtons(false);
 fmEnterDMC            := TfmEnterDMC.Create(NIL); // create the form
 fmEnterDMC.OnClose    := OnDmcClose; // the OnClose handler for later freeing the closed modal form
 fmEnterDMC.Enter; // call a member procedure that calls ShowModal
end;

// free the closed modal form when it returns
procedure TfmMain.OnDmcClose(Sender: TObject);
begin
 ShowMessage('OnDmcClose'); 
 fmEnterDMC.Free;
 EnableSearchButtons(true);
end;
-----------------------------------
// in the called form call ShowModal
procedure TfmEnterDMC.Enter;
begin
 ShowModal;
end;

Thert is a button in the modal form, when clicked calls "Close".
procedure TfmEnterDMC.btnSearchClick(Sender: TObject);
begin
 Close;
end;



Comments Comments
The problem was that IE was firing focus events for forms, and the last active control would get set to the form. This completely botched up EWB's logic for handling the focus of actual controls, as opposed to forms.


Resolution Resolution
Fixed Problem on 10/3/2016 in version 2.06 build 1


Products Affected Products Affected
Elevate Web Builder
Elevate Web Builder Trial

Image