unit View.Home;

interface

uses
  System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
  WEBLib.Forms, WEBLib.Dialogs, Vcl.Controls, Vcl.StdCtrls, WEBLib.StdCtrls;

type
  TFHome = class(TWebForm)
    edtCode: TWebEdit;
    edtTaskId: TWebEdit;
    edtUserId: TWebEdit;
  private
    FTaskId: string;
    FUserId: string;
    FCode: string;
  public
    class function CreateForm(AElementID, ATaskId, AUserId, ACode: string): TWebForm;
    procedure InitializeForm;
  end;

var
  FHome: TFHome;

implementation


{$R *.dfm}


class function TFHome.CreateForm(AElementID, ATaskId, AUserId, ACode: string): TWebForm;

  procedure AfterCreate(AForm: TObject);
  begin
    TFHome(AForm).FTaskId := ATaskId;
    TFHome(AForm).FUserId := AUserId;
    TFHome(AForm).FCode := ACode;
    TFHome(AForm).InitializeForm;
  end;

begin
  Application.CreateForm(TFHome, AElementID, Result, @AfterCreate);
end;

procedure TFHome.InitializeForm;
begin
  console.log('TFHome.InitializeForm fired');
  console.log('TaskId=' + FTaskId);
  console.log('UserId=' + FUserId);
  console.log('Code=' + FCode);

  edtTaskId.Text := FTaskId;
  edtUserId.Text := FUserId;
  edtCode.Text := FCode;
end;


end.
