|
<< Click to Display Table of Contents >> Navigation: Forum > Problems with modal dialogs with frames |
06-05-2019, 07:51 AM:
Hi, I'm attempting to show alternatively two modal dialogs using two TIWFrame and TIWModalWindows.
In IWAppFormCreate event I have added this code to create the frames:
// Create first frame
FFrameInput:=TIWFrameInput.Create(WebApplication);
FFrameInput.Name:='FrameInput';
FFrameInput.Top := 0;
FFrameInput.Left := 0;
FFrameInput.IWFrameRegion.Parent:=Self;
FFrameInput.IWFrameRegion.Visible:=False;
// Create second frame
FFrameFilter:=TIWFrameFilter.Create(Self);
FFrameFilter.Name:='FrameFilter';
FFrameFilter.Top := 0;
FFrameFilter.Left := 0;;
FFrameFilter.IWFrameRegion.Parent:=Self;
FFrameFilter.IWFrameRegion.Visible:=False;
Then I attempt to display the FFrameFilter using TIWModalWindows with this code when I press a button in main form:
RenderInvisibleControls:=True;
with IWModalWindow1 do
begin
Reset;
Buttons.CommaText := '&Ok,&Cancel';
Title := 'Filter';
ContentElement :=FFrameFilter.IWFrameRegion;
OnAsyncClick := FrameFiltroDoOnAsyncClick;
Show;
end;
But instead the FFrameFilter the system displays the other one, the FFrameInput !
I assign to ContentElement the FFFrameFilter.IWFrameRegion and it display the FFrameInput.IWFrameRegion !!!
If in IWAppFormCreate I remove the code for creating the FFrameInput leaving only this code:
// Create only the second frame
FFrameFilter:=TIWFrameFilter.Create(Self);
FFrameFilter.Name:='FrameFilter';
FFrameFilter.Top := 0;
FFrameFilter.Left := 0;;
FFrameFilter.IWFrameRegion.Parent:=Self;
FFrameFilter.IWFrameRegion.Visible:=False;
the system display correctly the dialog...
How it's possible ? Any idea to solve the issue ?
Francesco
06-06-2019, 07:59 PM:
Please send me a working example where I you can recreate the issue and I can have a look. My e-mail is alexandre [at] atozed dot com. Also, I need to know the Delphi version and IW version you are using
06-09-2019, 02:38 AM:
I tried several different test cases and couldn't recreate this issue.
06-09-2019, 04:39 AM:
Can you display both frames on the base form (ignore modal display for test).
Assure that the names used on the browser side are unique (ref IWFrameRegion on both frames).
Dan
06-12-2019, 10:37 AM:
Hi Francesco,
i got the same problem with
C++Builder 10.3 Update 1 and
IntraWeb 15.0.22 Ultimate edition.
The problem seems to be related to the TIWFrameRegion object which is created for each frame automatically.
My workaround was to create a separate content region with different names below IWFrameRegion and initialize as follows:
// Create first frame
FFrameInput->IWFrameRegion->Parent = NULL;
FFrameInput->IWFrameRegion->Visible = false;
FFrameInput->IWFrameRegionInput->Parent = this;
FFrameInput->IWFrameRegionInput->Visible = false;
// Create first frame
FFrameFilter->IWFrameRegion->Parent = NULL;
FFrameFilter->IWFrameRegion->Visible = false;
FFrameFilter->IWFrameRegionFilter->Parent = this;
FFrameFilter->IWFrameRegionFilter->Visible = false;
You don't need to use two TIWModalWindow objects if you assign the event handler dynamically.
Jürgen