Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Want simple JS demo
#22
Thanks Alexandre, it's work now.
I add comment for it.
(Hope this forum support monospaced font)
--------------------------------------------
implementation

{$R *.dfm}
var user_TZOS : string; // for global used

procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
  HIDDEN_TZOS_EDIT.Text := 'No Changed';
  user_TZOS            := 'No Changed';

// On Create, run the javascript and DISPLAY UnControllable ajax value to EDIT field (Its not real value in EDIT.TEXT)
// (The FIELD NAME must all Upper case characters)
  Self.JavaScript.Add('document.addEventListener("DOMContentLoaded", function() {' + sLineBreak +
  'var d = new Date();' + sLineBreak +
  'var tn = d.getTimezoneOffset();' + sLineBreak +
  'document.getElementById("HIDDEN_TZOS_EDIT").value = tn;' + sLineBreak +
  '});');

// Make an event call to FIRE 'AJAX_Func' function, by Pre-Defined Tstrings(use of Javascript) "timeZoneOffset" variable
  IWButton1.ScriptEvents.HookEvent('onclick', 'ajaxCall("AJAX_Func", "timeZoneOffset=" + IW.$("HIDDEN_TZOS_EDIT").value);');

// Registed ajax function and define Converting Procedure
  WebApplication.RegisterCallBack('AJAX_Func', procedure (aParams: TStrings)
                                                  begin
                                                    // Let the EDIT.TEXT display value to be real controllable
                                                    HIDDEN_TZOS_EDIT.Text := aParams.Values['timeZoneOffset'];
                                                    user_TZOS := aParams.Values['timeZoneOffset'];
                                                  end);
end;

procedure TIWForm1.IWButton2AsyncClick(Sender: TObject; EventParams: TStringList);
begin
  Webapplication.ShowMessage('HIDDEN_TZOS_EDIT : ' + HIDDEN_TZOS_EDIT.Text);
  Webapplication.ShowMessage('Global variable user_TZOS : ' + user_TZOS);
end;


-----------------------------------------------

More ! For remark...

HTTP.sys isn't compatible with the ASP.NET Core Module and can't be used with IIS or IIS Express.
https://docs.microsoft.com/en-us/aspnet/...etcore-2.2

Hope no need to touch that
https://support.microsoft.com/en-us/help...or-windows

(My IIS uninstallation may be not clear enough, still finding out how)
Reply


Messages In This Thread
Want simple JS demo - by Kristy - 08-16-2019, 06:54 AM
RE: Want simple JS demo - by Kristy - 08-16-2019, 08:50 AM
RE: Want simple JS demo - by Jose Nilton Pace - 08-16-2019, 11:17 AM
RE: Want simple JS demo - by kudzu - 08-16-2019, 12:22 PM
RE: Want simple JS demo - by Kristy - 08-16-2019, 01:25 PM
RE: Want simple JS demo - by Kristy - 08-17-2019, 03:53 AM
RE: Want simple JS demo - by Jose Nilton Pace - 08-17-2019, 09:38 PM
RE: Want simple JS demo - by Kristy - 08-18-2019, 01:17 AM
RE: Want simple JS demo - by Kristy - 08-18-2019, 06:28 AM
RE: Want simple JS demo - by DanBarclay - 08-18-2019, 06:55 AM
RE: Want simple JS demo - by Kristy - 08-18-2019, 07:47 AM
RE: Want simple JS demo - by Alexandre Machado - 08-18-2019, 09:45 PM
RE: Want simple JS demo - by Kristy - 08-19-2019, 03:14 AM
RE: Want simple JS demo - by DanBarclay - 08-19-2019, 03:35 AM
RE: Want simple JS demo - by DanBarclay - 08-18-2019, 05:54 PM
RE: Want simple JS demo - by kudzu - 08-18-2019, 06:51 PM
RE: Want simple JS demo - by Alexandre Machado - 08-19-2019, 03:25 AM
RE: Want simple JS demo - by Kristy - 08-19-2019, 05:02 AM
RE: Want simple JS demo - by DanBarclay - 08-19-2019, 05:14 AM
RE: Want simple JS demo - by Kristy - 08-19-2019, 06:35 AM
RE: Want simple JS demo - by Alexandre Machado - 08-19-2019, 08:24 AM
RE: Want simple JS demo - by Kristy - 08-19-2019, 09:56 AM
RE: Want simple JS demo - by Alexandre Machado - 08-21-2019, 02:44 AM
RE: Want simple JS demo - by Kristy - 08-21-2019, 03:13 AM
RE: Want simple JS demo - by DanBarclay - 08-21-2019, 03:24 AM
RE: Want simple JS demo - by kudzu - 08-21-2019, 02:57 PM
RE: Want simple JS demo - by Kristy - 08-23-2019, 04:29 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)