Results 1 to 2 of 2

Hybrid View

  1. #1
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    516

    Lightbulb How to access the LightstreamerEngine object from a Push-page

    The preferred way to access the LightstreamerEngine object from a Push-page is through the onEngineReady() event handler callback of the PushPage object. You will be passed a reference to the LightstreamerEngine object (that you can save for subsequent uses) as soon as it is ready. A typical implementation could be the following:
    Code javascript:
    1. var e; //LightstreamerEngine object reference
    2. var p = new PushPage();
    3. p.onEngineReady = function(engine) { e = engine }
    4. p.bind();
    5. // one on the possible ways of setting the engine
    6. p.loadEngine(“lsengine.html?config=lsengine_config.js);
    7.    // first alternative way
    8.    // p.loadEngineMinimal(“lsengine.html”, “MyEngine”);
    9.    // second alternative way   
    10.    // p.setEngineReference(parent.frames[“MY_ENGINE_FRAME”]);
    11.    // third alternative way
    12.    // p.setEngineReference(null, “MyEngine”);
    The result is that the variable “e” of the Push-page will contain a reference to the LightstreamerEngine object only when the engine is actually ready.

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784

    onEngineLost

    Sometimes the "link" between the LightstreamerEngine and a Push-page is lost (eg. if the Push-page is a pop-up and the opener page - that contains the LightstreamerEngine - gets closed)
    Lightstreamer web client detects such cases and notifies the PushPage object.
    You should just remember to delete the stored reference when you get an onEngineLost call:
    Code javascript:
    1. p.onEngineLost = function() { e = null; }

 

 

Similar Threads

  1. Anchor targetting in push page in Firefox, Chrome
    By tsezuu in forum Client APIs
    Replies: 2
    Last Post: November 24th, 2011, 03:09 AM
  2. How to JSON Object in Java Adapters as input
    By arunj in forum Adapter APIs
    Replies: 4
    Last Post: February 10th, 2011, 12:32 PM
  3. Replies: 3
    Last Post: November 11th, 2010, 07:09 AM
  4. LightStreamer with AMF object support
    By sachinpatel2 in forum Client APIs
    Replies: 1
    Last Post: September 10th, 2010, 10:01 AM
  5. Master push page in iframe
    By ivailo in forum Client APIs
    Replies: 1
    Last Post: July 24th, 2008, 08:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 11:28 PM.