-
August 6th, 2007, 09:54 AM
#1
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
#2
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
#3
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
#4
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
#5
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:25 PM.
Bookmarks