Posts: 23
Threads: 5
Joined: May 2018
Reputation:
0
Location: HELL
Really worst documentation. The javascript demo show nothing except .res. Some tell to use hidden component but no detail. Some refer to RegisterCallBack but no JS related. Some telling how to load JS in many way but nothing handle JS data passing by. Is Intraweb always as beta? Forever!
Just a simple question, search for a day without ensure answer.
Posts: 1,136
Threads: 37
Joined: Mar 2018
Reputation:
30
Location: Limassol, Cyprus
I must say that is the best looking PHP code I have ever seen!
Posts: 23
Threads: 5
Joined: May 2018
Reputation:
0
Location: HELL
08-17-2019, 03:53 AM
(This post was last modified: 08-17-2019, 04:07 AM by Kristy.)
That also not work. IW 14 method also not work, everything not work!
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
RegisterCallBack('TZOS',
procedure (aParams: TStrings)
begin
IWEdit1.text := aParams.Values['tn'];
end
);
end;
procedure TIWForm1.IWButton1AsyncClick(Sender: TObject; EventParams: TStringList);
var
TZJS_str : string;
begin
TZJS_str := 'function TZoffset(){'+ #13#10
+'var d = new Date();'+ #13#10
+'var tn = d.getTimezoneOffset();'+ #13#10
+'return tn;'+ #13#10
+'}';
WebApplication.CallBackResponse.AddJavaScriptToExecute('ajaxCall("TZOS", "&tn=" + TZJS_str)');
end;
Not work...
procedure TIWForm1.IWButton1AsyncClick(Sender: TObject; EventParams: TStringList);
var
TZJS_str : string;
begin
TZJS_str := 'function TZoffset(){'+ #13#10
+'var d = new Date();'+ #13#10
+'var tn = d.getTimezoneOffset();'+ #13#10
+'document.getElementById("IWEDIT1").innerHTML = tn;'+ #13#10
+'}';
WebApplication.CallBackResponse.AddJavaScriptToExecute(TZJS_str);
end;
Posts: 227
Threads: 4
Joined: Mar 2018
Reputation:
22
Hi Kristy,
I downloaded the demo Jose provided and tried it here, it works fine. I'm running IW 15.1.2, just haven't installed 15.1.3 yet, but that shouldn't matter.
If you run the demo, exactly what are you seeing?
Run the demo, you should see a button and textbox. Textbox will contain the default text "IWEdit1".
When you press the button it will execute the callback, replacing the "IWEdit1" with "something", and also show the notification.
Where does your execution break down?