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);
},
|