Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Main form getting notified when dataset has loaded
Thu, Nov 10 2016 2:08 AMPermanent Link

Richard Mace

Hi,

I am using EDB with EWB and I have a main form and a database form that was created by EWB.

On my database form I have dataset.  I understand that EWB and JavaScript are async and that I need to write code in the AfterLoad event of the dataset.

My question is,  how do I code an event so that my main form is notified when the dataset has loaded?

Thanks

Richard
Thu, Nov 10 2016 6:34 AMPermanent Link

Walter Matte

Tactical Business Corporation

Richard:

I call back to Main form,

In Main Form

public
 procedure CallBackFromChild(Sender : TObject);


TfrmMain.CallBackFromChild(Sender : TObject);
begin

 ShowMessage('I am called by child form - Dataset Loaded!!');

end;


TfrmMain.ButtonClick(Sender : TObject);
begin

 // Tell Child Form where to Callback

 frmChild.MainCallBack := CallBackFromChild;
 frmChild.ShowModal;

end;


// --   CHILD FORM -- //

  private
     { Private declarations }

     FMainCallBack : TNotifyEvent;
  public
     { Public declarations }
     property MainCallBack : TNotifyEvent read FMainCallBack write FMainCallBack;
  end;



// Somewhere in Child  do:


 If assigned(FMainCallBack) then
   FMainCallBack(Sender);


Walter
Thu, Nov 10 2016 3:29 PMPermanent Link

Richard Mace

Walter Matte wrote:

<< Richard:

<<I call back to Main form,

Thanks Walter, that looks like it works.

Richard
Image