Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41

    createEngine should be in the BODY ??

    Hi everybody,
    i have a windows that pops'up saying:
    1: 12:32: 11,154 E1 createEngine The createEngineO method should be called in the BODY part of ihe page, not in the HE...
    after 1second or 2, another window pops'upsaying:
    2: 12:44:49, 507 E1 createEngine The call of createEngineO method after the BODY onload event is supported only for DOM2 browsers.
    after some time, another window pops'upsaying:
    3: 12:41:36,962 ER bind The call of createEngine methods after the BODY onload event is supported only for DOM2 browsers. You might have reached this point, due to slow page downloads.
    this errror occurs only in safari and chrome browser. it's working fine with ie7 and ie8 and firefox.
    Can you tell me why is this happening ?

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

    the first alert is self-explaining, you should call the createEngine method on a script that is within the body element of the page.
    It is not mandatory as the library will recover anyway.


    the second and third messages are obsolete and are not present in the latest library build. Btw it's weird that you got all the three alerts, where/when do you call the createEngine method?

    Please upgrade the library and let me know if there are still problems.

  3. #3
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    i upgraded my libraries.
    the 2 last message don't appear anymore, but still the first one pops up every 2 or 5 seconds, that is:
    4: 13:2: 54,42 ER The createEngine() method should be called in the BODY part of ihe page, not in the HEAD createEngine
    i've put this code in different places (in the head, in the onload() function, in body,..), but the message still the same :
    var pushPage = new PushPage();
    pushPage.context.setDebugAlertsOnClientError(true) ;
    pushPage.context.setDomain("mydodo.tn");
    pushPage.onEngineCreation = function(lsEngine) {
    lsEngine.context.setDebugAlertsOnClientError(true) ;
    lsEngine.connection.setLSHost("push.mydodo.tn");
    lsEngine.connection.setLSPort(8081);
    lsEngine.connection.setAdapterName("STOCKLISTDEMO" );
    lsEngine.changeStatus("STREAMING");
    };
    pushPage.bind();
    pushPage.createEngine("StockListEngine", "../flux/ls/", "SHARE_SESSION", true);
    this still works on firefox and ie, not chrome nor safari.

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    do you see any exception in the browser's error console?

    is it possible for you to show me the entire html of your page? (the simpler, the page that shows the issue is, the better)

    note that even if the message is shown, the library should be able to work anyway on both Safari and Chrome; does the library not work after the message or is the alert your only concern?

  5. #5
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    i see this error in chrome:
    TypeError: Cannot read property 'nodeType' of null
    the sources are attached to this message, also the generated html (because i'm using jsf + richfaces + facelets).

    the problem is that message appears every x seconds, and the data won't show up. this only works on ie and firefox.
    Attached Files Attached Files

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

    I had to modify the code a little bit as it has some dependencies I don't have.

    btw I see that you're calling the test method inside the onchange event of your <select>, this means that each time you change the selection, the test method is called and a new PushPage is created; this is not correct, you should create only one PushPage per document, so you should move the following code outside the onchange event and put it in a "static" <script> on the page (just before the blabla.js script inclusion should be good):



    the rest of the function, that creates and subscribes the table, can remain in the onchange event.

    Another strange thing is that you have lspushpage.js and lscommons.js in two different folders; you should keep all the library files together to avoid confusion.


    That said I still don't get how are you getting that repeated alert on your application.
    Please move the code as shown and then, if the alert persist, execute this code (after at least one alert is shown) and let me know the result:





    As a final note I suggest you to check out the Lightstreamer/DOCS-SDKs/sdk_client_web/doc/Web Client Dev.pdf file

    HTH

  7. #7
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    i changed the code that i gave, that's why it seemed a little wrong.
    i gave you the original unchanged new code.
    i moved the code as you said, but this still don't work for me ( but again, work in firefox and ie)

    and where should i put this code ?
    alert(document.getElementsByTagName("BODY")[0]);
    Attached Files Attached Files

  8. #8
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    you can bind that to something clickable and click it after the first alert, or you may add javascript: in front of it and use it as a bookmarklet.

    also check out if there are any errors in the javascript console

    also check out the list of downloaded files, is the lsengine.html file downloaded?

  9. #9
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    there's no javascript error in both ie, firefox and chrome.
    for the downloaded files, i don't find lsengine in chrome, but i find it in firefox.

    i did put that code in the end of the page, in firefox it says
    [object HTMLBodyElement]
    but in chrome it's :
    undefined
    Attached Files Attached Files

  10. #10
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    i found the solution. it's a facelet's problem (i think) with chrome as said here.
    i must include this:
    <f:view contentType="text/html">
    ...
    </f:view.
    in my <body>...</body> section.

    now,
    alert(document.getElementsByTagName("BODY")[0]);
    return to me [object HTMLBodyElement] like firefox, and things work fine.

    thank you for your help (well, that line of code helped me find the problem) and sorry for the annoyance.

 

 

Similar Threads

  1. createEngine should be in the BODY ??
    By mohamida in forum Client SDKs
    Replies: 10
    Last Post: August 18th, 2010, 01:50 PM
  2. Error: createEngine() has already been called
    By vaduganathan in forum Client SDKs
    Replies: 3
    Last Post: April 9th, 2010, 09:58 AM
  3. createEngine problem on ASP.NET application
    By gmotodd in forum Client SDKs
    Replies: 8
    Last Post: May 4th, 2009, 01:51 PM
  4. Difference between createEngine and seekEngine
    By webfg in forum Client SDKs
    Replies: 2
    Last Post: April 13th, 2009, 12:07 PM
  5. CreateEngine - path - issues in chrome
    By rd2008 in forum Client SDKs
    Replies: 6
    Last Post: October 10th, 2008, 12:09 PM

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 03:58 AM.