Browse Source

IHTMLClient interface

Michaël Van Canneyt 3 years ago
parent
commit
465f2395b8
1 changed files with 14 additions and 1 deletions
  1. 14 1
      packages/rtl/Rtl.HTMLActions.pas

+ 14 - 1
packages/rtl/Rtl.HTMLActions.pas

@@ -29,7 +29,7 @@ Type
    TForeachHTMLElementDataEx = {$ifdef pas2js}reference to {$endif} procedure (aElement : TJSHTMLElement; aData : TObject);
    TForeachHTMLElementData = {$ifdef pas2js}reference to {$endif} procedure (aElement : TJSHTMLElement);
 
-   THTMLCustomElementAction = class(TComponent)
+   THTMLCustomElementAction = class(TComponent,IHTMLClient)
    private
      FActionList: THTMLCustomElementActionList;
      FCSSSelector: String;
@@ -58,9 +58,12 @@ Type
      Procedure DoBind;
      Procedure DoBeforeBind; virtual;
      Procedure DoAfterBind; virtual;
+
    Public
      Destructor Destroy; override;
      Class Function GetElementValue(aElement : TJSHTMLElement) : String; virtual;
+     procedure HTMLLoaded;
+     procedure HTMLRendered;
      Class Procedure SetElementValue(aElement : TJSHTMLElement; const aValue : String; asHTML : Boolean = false); virtual;
      function GetParentComponent: TComponent; override;
      function HasParent: Boolean; override;
@@ -406,6 +409,16 @@ begin
   Result:=aElement.InputValue;
 end;
 
+procedure THTMLCustomElementAction.HTMLLoaded;
+begin
+  // Do nothing
+end;
+
+procedure THTMLCustomElementAction.HTMLRendered;
+begin
+  Bind;
+end;
+
 class procedure THTMLCustomElementAction.SetElementValue(
   aElement: TJSHTMLElement; const aValue: String; asHTML: Boolean);
 begin