Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IsPostBack Error
#6
(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;
Reply


Messages In This Thread
IsPostBack Error - by LorenSzendre - 09-26-2018, 04:30 PM
RE: IsPostBack Error - by Alexandre Machado - 09-27-2018, 05:10 AM
RE: IsPostBack Error - by Alexandre Machado - 09-27-2018, 09:26 AM
RE: IsPostBack Error - by LorenSzendre - 09-27-2018, 12:19 PM
RE: IsPostBack Error - by Alexandre Machado - 09-28-2018, 09:52 AM
RE: IsPostBack Error - by LorenSzendre - 09-28-2018, 10:32 AM
RE: IsPostBack Error - by Alexandre Machado - 10-01-2018, 11:32 PM
RE: IsPostBack Error - by LorenSzendre - 10-01-2018, 11:53 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)