Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IntraWeb 15.2.47 is out!
#4
(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
Reply


Messages In This Thread
IntraWeb 15.2.47 is out! - by Alexandre Machado - 11-26-2021, 07:41 PM
RE: IntraWeb 15.2.47 is out! - by Anto90 - 11-30-2021, 08:05 AM
RE: IntraWeb 15.2.47 is out! - by Anto90 - 12-01-2021, 07:14 AM
RE: IntraWeb 15.2.47 is out! - by Anto90 - 12-01-2021, 08:25 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)