Telegram_2020-08-06T08

<< Click to Display Table of Contents >>

Navigation:  Telegram > 2020 > 08 > 06 >

Telegram_2020-08-06T08

Telegram link

 

2020-08-06T08:47:40

 

You can Add:

 

document.getElementById('MyIWLabel').value = idnum;

 

AddChangedControl('MyIWLabel');

 

or if you add a value to a HiddenField at Delphi Side:

 

procedure TFrmMyIWForm.IWAppFormCreate(Sender: TObject);

 

begin

 

inherited;

 

HiddenFields.Add('MY_ID');

 

end;

 

at JS side:

 

document.getElementById('MY_ID').value = idnum;

 

AddChangedControl('MY_ID');

 

then after the Async event finished, at delphi side you can always query or set a value by calling:

 

read:

 

id := HiddenFields.Values['MY_ID'];

 

or

 

set

 

HiddenFields.Values['MY_ID'] := newID;

 


 

Telegram link

 

2020-08-06T08:54:36

 

jus as a Note: HiddenFields will only be rendered the first time the form is loaded or after a full submit, so if you wan to 'send' a value to JS (browser client) in an Async Event, it is better to use:

 

WebApplication.CallBackResponse.AddJavaScriptToExecute(Format(\document.getElementById('%s').value = %s;\+sLineBreak+

 

AddChangedControl('%s');\, ['MY_ID', QuotedStr('IDValueXXX'), 'MY_ID'] ));