unit View.Artist;

interface

uses
  System.SysUtils, System.Classes, WEBLib.Graphics, WEBLib.Forms, WEBLib.Dialogs,
  Vcl.Controls, WEBLib.Controls, Vcl.Forms,
  WEBLib.ExtCtrls, Vcl.StdCtrls, WEBLib.StdCtrls,

  Bcl.Rtti.Common;

type
  TFViewArtist = class(TWebForm)
    WebPanel1: TWebPanel;
    WebLabel1: TWebLabel;
    procedure WebFormCreate(Sender: TObject);
  private
    FChildForm: TWebForm;
    procedure ShowListForm;
    procedure ShowEditForm(AId: TValue);
  end;

var
  FViewArtist: TFViewArtist;

implementation

uses
  View.Artist.List,
  View.Artist.Edit;

{$R *.dfm}

procedure TFViewArtist.ShowEditForm(AId: TValue);
begin
  if Assigned(FChildForm) then
    FChildForm.Free;
  FChildForm := TFViewArtistEdit.CreateForm(WebPanel1.ElementID, @ShowListForm, AId);
end;

procedure TFViewArtist.ShowListForm;
begin
  if Assigned(FChildForm) then
    FChildForm.Free;
  FChildForm := TFViewArtistList.CreateForm(WebPanel1.ElementID, @ShowEditForm);
end;

procedure TFViewArtist.WebFormCreate(Sender: TObject);
begin
  ShowListForm;
end;

end.
