Event
|
Parameters
|
When it is triggered
|
Example
|
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");
}
|
onServerConnect
|
obj
|
The "onServerConnect" event is fired every time a "connect" command is exchanged between the browser and the ThinRDP 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();
}
|
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();
}
}
|
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);
}
|
onServerDisconnect
|
-
|
Anytime the Web client gets disconnected from the ThinRDP 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();
}
|
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);
}
|
onSessionStart
|
-
|
This event will be fired when the client session has been started on ThinRDP Server.
|
onSessionStart: function () {
$("#" + mythinrdp.rcParams.divId).show();
mythinrdp.updateTools();
}
|
onSessionEnd
|
message
|
As soon as the client Session is closed, the "onSessionEnd" event will be fired.
|
onSessionEnd: function (message) {
alert(message);
},
|