Jump to content

AddJS() don't execute


hph

Recommended Posts

procedure TUniServerModule.UniGUIServerModuleHTTPCommand(
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;
  var Handled: Boolean);
var
  sid: TUniGUISession;
  ActiveSessions : TUniGUISessions;
  I : Integer;
begin
  if ARequestInfo.URI='/test/send' then
  begin
    SessionManager.Sessions.Lock;
    ActiveSessions := UniServerModule.SessionManager.Sessions;
    try
      for I := 0 to ActiveSessions.SessionList.Count -1 do
      begin
        sid := ActiveSessions.SessionList[I];
        sid.AddJS('doShowText("Hello")');   // --- dont execute!?!
      end;
    finally
      SessionManager.Sessions.Unlock;
    end;
    AResponseInfo.ResponseNo := 200;
    AResponseInfo.ContentText := 'success';
    AResponseInfo.WriteContent;
    Handled := True;
  end;

end;

Hi

Why is this javascript function doShowText() in this active session not executing? It works if I call directly from UnimForm.UniSession.AddJS(), but not over the SessionManager...?

best regards

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...