-
August 5th, 2007, 10:46 PM
#1
Custom Connection Message
Hi,
Is it possible to inject code to have a UI similar to gmail gtalk ( or yahoo mail chat ) which can show "Connecting to chat server" and then if not present "not available" ?
Right now, is the server is not avaliable, it throws up a prompt every X secs. It would be great if we have the flexiblity of handling such cases so that so we have custom error messages and their formatting
-
August 5th, 2007, 10:48 PM
#2
Originally Posted by
rakeshxp
Hi,
Is it possible to inject code to have a UI similar to gmail gtalk ( or yahoo mail chat ) which can show "Connecting to chat server" and then if not present "not available" ?
Right now, is the server is not avaliable, it throws up a prompt every X secs. It would be great if we have the flexiblity of handling such cases so that so we have custom error messages and their formatting
I think I hit the enter too quickly :P
I am talking about LS + dojo integration ( and the wierd dialog prompts when the LS server is not available )
-
August 6th, 2007, 09:54 AM
#3
Hi,
The Dojo demo should not show "not connected" prompts but (if you're running it from LS internal web server) it could show debug messages.
In any case your desidered behavior is feasible.
Please take a look to these API:
http://www.lightstreamer.com/docs/cl...onStatusChange
http://www.lightstreamer.com/docs/cl...sOnClientError
And to these threads:
http://www.lightstreamer.com/vb/showthread.php?t=68
http://www.lightstreamer.com/vb/showthread.php?t=112
Hope that helps.
-
August 6th, 2007, 12:07 PM
#4
Mone, Thanks a lot!!!
This is exactly I was looking for
Please find the attached snippet and let me know if I have properly understood the api
var lsPage = new PushPage();
var e;
lsPage.context.setDebugAlertsOnClientError(false);
lsPage.context.setRemoteAlertsOnClientError(false) ;
lsPage.context.setDomain(domain);
lsPage.onEngineReady = function(engineRef) {
dojo.debug("Lightstreamer onEngineReady" ) ;
e = engineRef ;
engineRef.context.setDebugAlertsOnClientError(fals e);
engineRef.context.setRemoteAlertsOnClientError(fal se);
engineRef.connection.setUserName("cookie");
engineRef.connection.setPassword("password");
engineRef.connection.setLSHost(host);
engineRef.connection.setLSPort(port);
engineRef.connection.setAdapterName("XYZ");
engineRef.changeStatus("STREAMING");
e.onClientAlert = function ( code, message ) {
dojo.debug("WOW!!!! LightstreamerEngine onClientAlert code[" + code +"] message[" + message + "]" ) ;
}
e.onClientError = function ( message ) {
dojo.debug("WOW!!!! LightstreamerEngine onClientError message[" + message + "]" ) ;
}
e.onServerError = function ( code, message ) {
dojo.debug("WOW!!!! LightstreamerEngine onServerError code[" + code +"] message[" + message + "]" ) ;
}
e.onStatusChange = function ( chngStatus ) {
dojo.debug("WOW!!!! LightstreamerEngine onStatusChange status[" + chngStatus + "]" ) ;
}
}
lsPage.onEngineLost = function() { e = null; }
lsPage.onClientAlert = function ( code, message ) {
dojo.debug("WOW!!!! PushPage onClientAlert code[" + code +"] message[" + message + "]" ) ;
}
lsPage.onClientError = function ( message ) {
dojo.debug("WOW!!!! PushPage onClientError message[" + message + "]" ) ;
}
lsPage.onServerDeny = function ( message ) {
dojo.debug("WOW!!!! PushPage onServerDeny message[" + message + "]" ) ;
}
lsPage.bind();
lsPage.loadEngineMinimal("../struts/lightstreamer-client/lsengine.html");
Thanks,
Rakesh
-
August 6th, 2007, 12:12 PM
#5
Yes, it's ok
Just move from the deprecated loadEngineMinimal to the newer createEngine:
http://www.lightstreamer.com/docs/cl...l#createEngine
-
August 6th, 2007, 12:17 PM
#6
Thanks for the info. I will change to the new API.
Could you explain the difference between PushPage and Engine interms of error handling ? More specificly, do I need to add onClientAlert ( e.g ) on both PushPage and Engine? What are the scenarios when either of them is called ?
PS: I am already become a big fan of Lightstreamer! I couldn't find any page that tells me the pricing of the advanced version.
-
August 7th, 2007, 08:55 AM
#7
Similar Threads
-
By msgiribabu in forum Adapter SDKs
Replies: 4
Last Post: February 3rd, 2011, 10:33 AM
-
By rd2008 in forum Client SDKs
Replies: 3
Last Post: October 30th, 2008, 10:25 AM
-
By indrajit in forum Adapter SDKs
Replies: 7
Last Post: March 19th, 2008, 08:31 AM
-
By Waddy in forum General
Replies: 3
Last Post: March 6th, 2007, 09:43 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 05:26 AM.
Bookmarks