From f6aa05353b6f42c06a20485f522536b60100cbe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Sun, 31 Dec 2023 17:12:43 +0100 Subject: [PATCH] * Set field value on change --- packages/fcl-db/src/data.htmlactions.pp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/fcl-db/src/data.htmlactions.pp b/packages/fcl-db/src/data.htmlactions.pp index b52c8a7..928b668 100644 --- a/packages/fcl-db/src/data.htmlactions.pp +++ b/packages/fcl-db/src/data.htmlactions.pp @@ -124,8 +124,10 @@ Type end; TDBCustomHTMLInputElementAction = class(TDBCustomHTMLElementAction) + private Protected procedure DoKeyDown(aEvent: TJSEvent); override; + procedure DoEditChange(aEvent: TJSEvent); virtual; Procedure ActiveChanged; override; function NeedsClick(aEl: TJSElement): Boolean; Procedure StartEditing; override; @@ -525,9 +527,17 @@ begin aEl.addEventListener(sEventKeyDown,@DoKeyDown); if NeedsClick(aEl) then aEl.addEventListener(sEventClick,@DoKeyDown); + aEl.addEventListener(SEventChange,@DoEditChange); end; +procedure TDBCustomHTMLInputElementAction.DoEditChange(aEvent : TJSEvent); + +begin + if Link.Edit then + ElementToDataset; +end; + procedure TDBCustomHTMLInputElementAction.DoKeyDown(aEvent : TJSEvent); begin