(12-01-2021, 03:07 AM)Alexandre Machado Wrote: Hi, yes, I got your call stack.
I need a few more information from you:
what does this event handler do? BSINSERIMENTO.DoOnAsyncClick
Hi Alexandre,
BSInserimento.DoOnAsyncClick is an AsynClick of IWBSDROPDOWN. In this event is called this function
ShowForm(WebApplication,TBSInserimento,True);
Definition : function ShowForm(AWebApplication: TIWApplication; AFormClass: TIWAppFormClass; AReleaseCurrent: Boolean = False; ReCreate : boolean = False ): TIWAppForm;
Implementation
function ShowForm(AWebApplication: TIWApplication; AFormClass: TIWAppFormClass; AReleaseCurrent: Boolean; ReCreate : boolean): TIWAppForm;
var
LActiveForm: TComponent;
begin
Result := nil;
if not Assigned(AFormClass) then
begin
Exit;
end;
// If desired form is already active form there's no need to do anything
LActiveForm := AWebApplication.ActiveForm;
if Assigned(LActiveForm) and (AFormClass = LActiveForm.ClassType) and (ReCreate = False) then
begin
Exit(LActiveForm as TIWAppForm);
end;
// Check if desired form already exists. If so, use it, otherwise create a new one
Result := AWebApplication.FindFormByClassName(AFormClass.ClassName) as TIWAppForm;
if not Assigned(Result) then
begin
Result := AFormClass.Create(AWebApplication);
Result.Tag := 1;//indicatore che mi dice che la form è stata creata
end
else
begin
if ReCreate = True then //ricreo la form se necessario
begin
Result := AFormClass.Create(AWebApplication);
Result.Tag := 1;
end
else
Result.Tag := 2;
end;
// Show the form. Optionally destroy the current active form
if Assigned(Result) then
begin
Result.Show;
if AReleaseCurrent and Assigned(LActiveForm) then
begin
TIWAppForm(LActiveForm).Release;
end;
end;
end;
Thank you
Andrea