WEBLib.Forms TCustomForm.CreateNew

I have a problem to understand the parameters of TCustomForm.CreateNew in WEBLib.Forms line ~2737

I call the TWebForm CreateNew constructor. I want a callback, if the form is created.
I use the parameter "AProc: TFormCreatedProc".
But the callback is never called.

If I debug the code I see this lines:

 if AFileName <> '' then
    Application.LoadForm(Self, AFileName)
  else
    if Assigned(FCreatedProc) then
      FCreatedProc(Self);

The AFilename is always set. So the CreatedProc is not called

Did I not understand something there?

Just for better understanding
Here is my code in the main form

procedure TfrmMain.ShowFrame(AFrameClass: TWebBasisFormClass; KundenId: String);

  procedure OnCreated(AForm: TObject);
  begin
    TWebBasisForm( AForm).Init( [ TValue.From<String>( KundenId)]);
  end;

begin
  FCurrentFrame.Free;
  FCurrentFrame := AFrameClass.CreateNew( ParentElementId, TFormCreatedProc( @OnCreated));
end;

Sorry, my mistake.
I accidentally changed the parameter in the meantime.

Thread is done.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.