LogoLogo
HomeContact UsRegister for a live demo!Get a Quote
  • Thinfinity Remote Desktop 5
  • About This Document
  • Introduction
  • What's new in 5.0
  • Architecture
  • Security
  • Upgrade from 4.0
  • Getting Started Section
    • Getting Started
    • Installing Thinfinity® Remote Desktop
    • Using Thinfinity® Remote Desktop for the First Time
      • Verifying the Communication Settings
      • Connecting to a desktop
    • Customizing Thinfinity® Remote Desktop
      • Setting the Access Security Level
        • Access Profiles
          • RDP Profiles
            • Creating an RDP Profile
            • Editing an RDP Profile
            • Disabling an RDP Profile
            • Removing an RDP Profile
            • The "[+]" Profile
          • Weblink Profiles
            • Creating a Weblink Profile
            • Editing a Weblink Profile
            • Disabling a Weblink Profile
            • Removing a Weblink Profile
          • RD Web Access Profiles
            • Creating a RD Web Access Profile
            • Editing a RD Web Access Profile
            • Disabling a RD Web Access Profile
            • Removing a RD Web Access Profile
          • VNC / RFB Profile
            • Creating a VNC Profile
            • Editing a VNC Profile
            • Disabling a VNC Profile
            • Removing a VNC Profile
          • Telnet/SSH profile
            • Creating a Telnet Profile
            • Editing a Telnet Profile
            • Disabling a Telnet Profile
            • Removing a Telnet Profile
      • Testing Internal Access
      • Configuring Internet Access
      • Enabling Remote Sound
      • Mapping Remote Drives
        • Intermediate Disks
        • Shared Folders
    • After Customization
      • Connecting to a Desktop
      • Connecting to an Application
      • Performing a File Transfer
        • Navigating
        • File Options
        • Remote Folder Area Options
        • Downloading and Uploading files
    • Supported RDP Shortcut Keys
  • Advanced Settings Section
    • Advanced Settings
    • Thinfinity® Remote Desktop Manager
      • General
      • Broker
      • Authentication
        • OAuth/2
          • Methods
          • Settings
          • Mappings
          • Configure OAuth with Okta
          • Configure OAuth with Auth0
        • RADIUS
          • Settings
          • Mappings for SSO
        • TOTP (Time-based One-time Password)
          • TOTP Settings
      • Access Profiles
        • RDP Profile Editor
          • General
            • Setting up a Hyper-V Profile
            • Setting up an RDS Collection Profile
          • Display
          • Resources
          • Program
          • Experience
          • Advanced
          • Printer
          • Permissions
          • Restrictions
          • Access Hours
          • Authentication methods
        • Web Link Profile Editor
          • Web Link
          • Permissions
        • RD Web Access Editor
          • General
          • Permissions
        • VNC / RFB Profile Editor
          • Display
          • Permissions
          • Restrictions
          • Access Hours
          • Authentication methods
        • Telnet / SSH Profile Editor
          • Display
          • SSL
          • SSH
          • Options
          • Permissions
          • Authentication methods
          • Access Hours
          • Restrictions
      • Folders
      • Permissions
      • External DLL Authentication Method Settings
      • Duo Authentication Method Settings
        • How to configure DUO
      • SAML Authentication Method Settings
        • Configure SAML with Okta
        • Configure SAML with Centrify
  • Gateway Manager
    • Managing the SSL Certificate
      • The Default Embedded Certificate
      • A Self-Signed Certificate
      • A CA Certificate
  • License Manager
    • License Activation
    • Proxy Activation
    • Get a new Trial Serial Number
    • Activate a Serial Number Online
    • Activate a Serial Number Offline
    • Registering Your License With The License Server Manager
  • Custom Settings
    • Extend the Remote Desktop’s Toolbar
  • Customizing the Toolbar
    • Using customsettings.js
    • Using the 'connect' Method
  • Remote FX
  • Save Session
    • Record a Session
    • Play Recorded Sessions
  • Multi-touch Redirection
  • Enhanced Browser and DPI Support
    • Model Inheritance
    • Property Reference
    • The Calculation Process
    • Examples
  • Silent Install Options
  • Credentials Management
    • User-based Access Profiles
    • Credentials Management
  • Customize Translation
  • Mobile Devices Section
    • Mobile Devices
    • Getting into Thinfinity® Remote Desktop
    • Mouse Control
    • Keyboards and Toolbars
    • Gestures
    • Disconnecting from Thinfinity® Remote Desktop
    • iPad Application
      • Configuration
      • Side Bar
  • Scaling and Load Balancing Section
    • Scaling & Load Balancing
    • Scaling and Load Balancing Configurations
    • Installing Components
    • Configuring a Load Balancing Scenario
    • How to configure your license
  • Integrating Thinfinity® Remote Desktop Section
    • Integrating Thinfinity® Remote Desktop
    • SDK
      • Deploying
      • Using the SDK
      • SDK Login
      • Connect method
        • Placement
        • Destination and Authentication
        • Settings
          • kbdLayout Values
        • Features
        • Events
        • Toolbar Customization
      • Browser Resizing
      • Keystroke Methods
      • SSL Certificate
      • Demo
    • External Authentication
      • Apikey
    • Single Sign On
      • Facebook OAuth Authentication Example
      • Google OAuth/2
        • Google Client ID for Web Applications
      • RADIUS
    • Customizing the Web Interface
      • Changing the Logo
      • Customizing the Web Files
      • Files Location
    • Web Services API
      • Architecture
      • Installing the Web Service
      • Setting up the Communication Settings
      • Profiles Web Service
        • Methods
        • Types
          • The WS Profile type
        • The Demo Applications
      • Analytics Web Service
        • Methods
        • Types
          • WSQueryInfo
          • WSQueryRange
          • WSDBLoginRecord
          • WSSessionRecord
          • WSDBConnectionRecord
          • WSDBBrowserRecord
        • The Demo Application
    • One-Time-URL
      • Configuring the Connection
      • Enabling Features
  • User guide Section
    • User Guide
    • Logging In
    • Advanced Web Features
      • Tree View
      • Listing Options
      • Search bar
    • Accessing from Mobile Devices
      • Connecting with Open Parameters
        • General
        • Display
        • Resources
        • Program
        • Experience
        • Advanced
      • Connecting with Profiles
    • Toolbar
      • Actions
      • File Transfer
      • Options
      • Disconnect
    • Features
      • File Transfer
        • Navigating
        • File Options
        • Remote Folder Area Options
        • Downloading and Uploading files
      • Remote Printer
      • Remote Sound
      • Share Session
      • Mapped Drives
      • Analytics
        • Sessions
        • Connections
        • Logins
        • Browsers
        • Filter
        • Configuring MS SQL Server
          • Analytics Tables Reference
    • Disconnecting
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Integrating Thinfinity® Remote Desktop Section
  2. SDK
  3. Connect method

Events

Events

The events parameter allows you to handle each one of the available Thinfinity® Remote Desktop Server events from the SDK.

events: {
 onServerConnecting : function (reconnecting) { },
 onServerConnect : function () { },
 onQueryDisconnect : function () { },
 onServerConnectionError : function (errMessage) { },
 onServerDisconnect : function () { },
 onExecResult : function (cmd) { },
 onSessionStart : function () { },
 onSessionEnd : function (message) { },
 }

Observe in the code above that all the event functions are empty. In the following table you can find a description, parameters and a use example for each one of the available events:

Event

Parameters

When it is triggered

Example

events.onServerConnecting

reconnecting

This event is fired during the server connection establishment.

The 'reconnecting' argument informs whether this is a reconnection or a first-time connection.

onServerConnecting :

function (reconnecting) {

$.blockUI("Establishing connection");

}

events.onServerConnect

obj

The "onServerConnect" event is fired every time a "connect" command is exchanged between the browser and Thinfinity® Remote Desktop Server. It is a way of making sure the server received a sent "connect" command.

If you have shown a message on the onServerConnecting, this would be a good moment to hide that message ($.unblockUI();).

The 'obj' parameter ships the generated connection object.

onServerConnect :

function (obj) {

$.unblockUI();

}

events.onQueryDisconnect

-

Anytime the Web client is about to be disconnected, the "onQueryDisconnect" will

be triggered. This is useful to ask the user for confirmation before proceeding to disconnect.

onQueryDisconnect: function () {

if (confirm("A remote session is active. Are you sure you want to disconnect?"))

{

mythinrdp.disconnect();

}

}

events.onServerConnectionError

errMessage

If an error prevents the client connection to be established, this event will be fired. The errMessage argument brings the error message.

onServerConnectionError: function (errMessage){

alert("connect error: " + errMessage);

}

events.onServerDisconnect

-

Anytime the Web client gets disconnected from Thinfinity® Remote Desktop Server, the "onServerDisconnect" event will be fired. It could be triggered because the connection was lost incidentally or also because the user disconnected from the server on purpose.

onServerDisconnect: function () {

alert("disconnect");

$.unblockUI();

mythinrdp.updateTools();

$("#" + mythinrdp.rcParams.divId).hide();

}

events.onExecResult

cmd

This event fires only when the SDK is integrated with a remoteApp application.

Through this event it is possible to get to know if the remoteApp was started or if there was an error during the application start up.

If the application was started without errors, the cmd.rc is going to be 0, otherwise cmd.rc will carry the application error code. As you can see on the example below you can also get the executable name accessing the cmd.exename value.

onExecResult: function (cmd) {

alert("exename: " + cmd.exename + " rc: " + cmd.rc);

}

event.onExecRemoteApp

This event is fired when the remote server starts the execution of a RemoteApp.

onExecRemoteApp: function (cmd) {

alert("The application is starting");

}

event.onInteractionRequired

This event is fired during the connection process to a RemoteApp either when the systems requires a user interaction to proceed before being able to open the application —such as a UAC prompt—; or when the application is ready.

In some cases, the application might be starting and the user might not have access to the blocked screen, so it might need to be unblocked programatically.

onInteractionRequired: function () {

$.UnBlockUI();

}

events.onSessionStart

-

This event will be fired when the client session has been started in Thinfinity® Remote Desktop Server.

onSessionStart: function () {

$("#" + mythinrdp.rcParams.divId).show();

mythinrdp.updateTools();

}

events.onSessionEnd

message

As soon as the client Session is closed, the "onSessionEnd" event will be fired.

onSessionEnd: function (message) {

alert(message);

},

Note 1 : This event usage reference can also be found in the sdk.html file, located in the application directory, under the "webrdp" directory.

Note 2 : In versions previous to 2.2.0.20 the SDK events had a different syntax. That old sintax is still compatible with newer versions. However, it is highly recommended to translate the old code to the method described above.

This is how the previous event names are related to new ones:

Old Event Name

Current Event Name

establishingConnection

events.onServerConnecting

serverConnect

events.onServerConnect

execResult

events.onServerConnect

sessionStart

events.onSessionStart

serverConnectionError

events.onServerConnectionError

disconnectConfirmRequest

events.onQueryDisconnect

serverDisconnect

events.onServerDisconnect

sessionEnd

events.onSessionEnd

PreviousFeaturesNextToolbar Customization

Last updated 4 years ago

Was this helpful?