Jump to content

Desktop Login Form ThreadTimer Ajax Event - How ?


andyhill

Recommended Posts

I have spent 3 and a half years exclusively in the UniGUI Mobile world where most things work after effort and today tried to build the most simplest Desktop App with a Login Form and Thread Timer.

I cannot get the Thread Timer Event to call the fLogin Form Ajax Event ? Please advise - Thanks

 

procedure TfLogin.ttTimeOutTimer(Sender: TObject);
begin
  ttTimeOut.Enabled:= False;
  WaitFlag:= False;

  // Below Fails (along with about 10 other variants of calling)
  UniSession.AddJS('ajaxRequest(fLogin.window, "_TimerReset_", []');
  UniSession.AddJS('ajaxRequest(' + fLogin.Form + ', "_TimerReset_", []');
  UniSession.AddJS('ajaxRequest(' + fLogin.WebForm.JSName + ', "_TimerReset_", []');
  UniSession.AddJS('ajaxRequest(' + Chr(39)+fLogin.GetWebForm.Name+Chr(39) + ', "_TimerReset_", []');

end;

procedure TfLogin.UniLoginFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
begin
  if EventName = '_TimerReset_' then begin 
    Caption:= 'Login';
    UniSession.Synchronize();
  end;
end;

 

Link to comment
Share on other sites

1 hour ago, andyhill said:

I cannot get the Thread Timer Event to call the fLogin Form Ajax Event ? Please advise - Thanks

"TuniThreadTimer is a server side timer. It runs in server in its own thread and has no connection to client side. It is not bound to any session. It can be used to run server side tasks and other internal tasks."

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...