09-28-2018, 10:32 AM
(09-28-2018, 09:52 AM)Alexandre Machado Wrote: How do you create and show this form? Is it handled by some content handler or....?
IsPostBack logic is very simple and hasn't changed since first implemented. It will evaluate to True if form execution count is greater than 1 and request is a POST request (this differs from ASP.NET IsPostBack which might be true even if the request is a GET).
Here's how I create and show this form:
var
Mgr: TpgSwovoMgr;
begin
Mgr := TpgSwovoMgr.Create(WebApplication);
if cbLang.ItemIndex <> -1 then
begin
Mgr.gInitialChronosID := Integer(cbLang.Items.Objects[cbLang.ItemIndex]);
end;
Mgr.Show;
end;
Then in the form itself for OnRender I have:
procedure TpgSwovoMgr.IWAppFormRender(Sender: TObject);
var
i: Integer;
begin
inherited;
if not IsPostBack then
begin
DM := LockDataModule;
ObjMgr := TObjectManager.Create(TFireDACConnectionAdapter.Create(DM.MainCx, False));
// some other stuff
end;
end;