Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Hosting multiple forms in other controls

 Post Reply Post Reply
Author
Mitchell Hilary View Drop Down
New Member
New Member
Avatar

Joined: 23 Feb 2018
Posts: 17
Post Options Post Options   Quote Mitchell Hilary Quote  Post ReplyReply Direct Link To This Post Topic: Hosting multiple forms in other controls
    Posted: 25 Jul 2018 at 8:21am
I was wondering, is it possible to host, let's say two forms in two panels side by side?
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 7921
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 25 Jul 2018 at 8:24am
Yes that should be possible.
Back to Top
Mitchell Hilary View Drop Down
New Member
New Member
Avatar

Joined: 23 Feb 2018
Posts: 17
Post Options Post Options   Quote Mitchell Hilary Quote  Post ReplyReply Direct Link To This Post Posted: 25 Jul 2018 at 8:48am
When I try to do following, only AfterCreate2 is being called, the form doesn't show show up. Form2 doesn't show up either and AfterCreate1 is not called at all.

Form2 creates fine and AfterCreate1 is called when I comment out
//Form3 := TForm3.CreateNew...
Form3 creates fine and AfterCreate2 is called when I comment out
//Form2 := TForm2.CreateNew...

var
  Form1: TForm1;
  Form2: TForm2;
  Form3: TForm3;

procedure TForm1.WebButton1Click(Sender: TObject);
  procedure AfterCreate1(AForm: TObject);
  begin
    if (Assigned(Form2)) and (Form2 is TForm2) then
      ShowMessage('Form2');
  end;
  procedure AfterCreate2(AForm: TObject);
  begin
    if (Assigned(Form3)) and (Form3 is TForm3) then
      ShowMessage('Form3');
  end;
begin
  Form2 := TForm2.CreateNew(WebPanel1.ElementID, @AfterCreate1);
  Form3 := TForm3.CreateNew(WebPanel2.ElementID, @AfterCreate2);
end;

I disabled automatic creation of Form2 and Form3 in Project file.
Back to Top
Ibrahim Ahmed A View Drop Down
Member
Member
Avatar

Joined: 26 May 2014
Posts: 50
Post Options Post Options   Quote Ibrahim Ahmed A Quote  Post ReplyReply Direct Link To This Post Posted: 25 Jul 2018 at 10:08am
is it possible to show them as windows,  that is as popup Dialog?
Back to Top
Mitchell Hilary View Drop Down
New Member
New Member
Avatar

Joined: 23 Feb 2018
Posts: 17
Post Options Post Options   Quote Mitchell Hilary Quote  Post ReplyReply Direct Link To This Post Posted: 25 Jul 2018 at 10:37am
Not if I do this:
  Form2 := TForm2.CreateNew(@AfterCreate1);
  Form3 := TForm3.CreateNew(@AfterCreate2);
  Form2.Popup := true;
  Form2.ShowModal;

I get only white page (probably some part of the popup, it disappears when I click in the address bar, but no components that I actually put on the popup form).

If I don't load Form3 in the variable then it works fine.
  Form2 := TForm2.CreateNew(@AfterCreate1);
  Form2.Popup := true;
  Form2.ShowModal;
Back to Top
Mitchell Hilary View Drop Down
New Member
New Member
Avatar

Joined: 23 Feb 2018
Posts: 17
Post Options Post Options   Quote Mitchell Hilary Quote  Post ReplyReply Direct Link To This Post Posted: 25 Jul 2018 at 1:18pm
Interestingly enough, it works if you don't create the two forms one after another but rather space it out in time. I think it is still an issue though.
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 7921
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 26 Jul 2018 at 3:25pm
We have applied an improvement for this. We'll release an update with this improvement asap.
Back to Top
Mitchell Hilary View Drop Down
New Member
New Member
Avatar

Joined: 23 Feb 2018
Posts: 17
Post Options Post Options   Quote Mitchell Hilary Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jul 2019 at 2:49pm
Hi, just a quick question, what is the fix for this issue?
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 7921
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jul 2019 at 3:05pm
Please install the latest version where this issue was addressed.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down