Results 1 to 4 of 4

Hybrid View

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

    you're (as usually ) right, such getters are not available.

    we're valuating to include them in our next release, btw in any case, if we add such getters, note that, for "null,null"-constructed tables, you can't use them before the addTable call is issued as that call is where the table object is bound to it's html counterpart so that it can read it's group and schema from the DOM.

  2. #2
    Member
    Join Date
    Dec 2008
    Location
    Karlsruhe
    Posts
    7
    Quote Originally Posted by Mone
    we're valuating to include them in our next release, btw in any case, if we add such getters, note that, for "null,null"-constructed tables, you can't use them before the addTable call is issued as that call is where the table object is bound to it's html counterpart so that it can read it's group and schema from the DOM.
    Oh, yes, of course, I missed the call to "PushPage.addTable()" in my few example lines, thanks for the hint.

    Nevertheless I think the getters should be "usable" even before "addTable()", i.e. they would just return "null". If you say "..can't use them before.." it sounds as if that would result in an error, so I just wanted to clarify this point.

    Furthermore, I can use Table.getId() to find out if the table has been added (i.e. is in running state), so I could do something like IMHO it would be even better if there were dedicated callback interfaces similar to "onStart()", something in the line of "onAdd()" and "onRemove()", because if I'm not mistaken "onStart()" is not necessarily called right away after the "addTable()"-call finishes, but only after the the Lightstreamer server has received and answered the subscription-request. This would mean that "onStart()" wouldn't be called if there's a network problem, even though the HTML cells have been processed by the "addPage()"-call, so the table-objects knows which fields and items the table contains.

    And as far as I can tell there's no way at the moment to get notified if a table is removed via "removeTable()", not even a counterpart to "onStart()" like "onStop()".

    But if there were "onAdd()" and "onRemove()" callbacks I could just use them like this: ..and I'm done.

    By the way, I just noticed that the "onStart()"-callback has no parameter - wouldn't it be a good idea to hand a reference to the table-object to the called function, i.e. change the "onStart()"-definition from
    Code:
    void onStart()
    to
    Code:
    void onStart(<Table> tableSpec)
    That way you could use one central function to handle all the "onStart()"-callbacks, and choose different actions depending upon the table id or even the class of the table (by using "getClassName()"): At the moment you have to specify separate functions as there's no indication for which table instance the "onStart()" callback has been called.


    Oh, there's one other question I have regarding "addTable()" and "removeTable()" (sorry, quite a lot for one post, I know). When I call "addTable()" the first time, the library scans the DOM for the HTML elements to associate the table to. But when I do something like this over the lifetime of the page: ..what happens during the second call to 'addTable()'? Does the Lightstreamer library remember that it already searched through the DOM for that particular table identifier, or is the DOM-search repeated? This would be good to know for the use-case of manipulating the DOM via JavaScript, i.e. adding another table row dynamically..

  3. #3
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Nevertheless I think the getters should be "usable" even before "addTable()", i.e. they would just return "null". If you say "..can't use them before.." it sounds as if that would result in an error, so I just wanted to clarify this point.
    right

    IMHO it would be even better if there were dedicated callback interfaces similar to "onStart()", something in the line of "onAdd()" and "onRemove()", because if I'm not mistaken "onStart()" is not necessarily called right away after the "addTable()"-call finishes, but only after the the Lightstreamer server has received and answered the subscription-request. This would mean that "onStart()" wouldn't be called if there's a network problem, even though the HTML cells have been processed by the "addPage()"-call, so the table-objects knows which fields and items the table contains.

    And as far as I can tell there's no way at the moment to get notified if a table is removed via "removeTable()", not even a counterpart to "onStart()" like "onStop()".
    you don't need such events as:
    onAdd would be fired during the addTable execution that's called by you
    onRemove would be fired during the removeTable execution that's called by you
    onStop would be fired just before an onStatusChange("DISCONNECTED") event or before an onEngineLost() one, so that you already have a place to hndle such event.

    In conclusion I think that, at least for the moment, those events will not be included.

    By the way, I just noticed that the "onStart()"-callback has no parameter - wouldn't it be a good idea to hand a reference to the table-object to the called function, i.e. change the "onStart()"-definition from [...]
    you can use the this from inside the onStart callback to check wich table you're processing


    ..what happens during the second call to 'addTable()'? Does the Lightstreamer library remember that it already searched through the DOM for that particular table identifier, or is the DOM-search repeated? This would be good to know for the use-case of manipulating the DOM via JavaScript, i.e. adding another table row dynamically..
    The library does the search on the DOM each time the addTable is called, so you can remove a table, change the html and re-add the same "null-null" table resulting in a table with a different group/schema.
    The only exception is if you give a ScreenTableHelper to the PushPage. In such case the DOM is never searched, so, to change the group/schema of your "null-null" table, you should, remove the table, add new cells to the ScreenTableHelper instance and re add the table.

    HTH

 

 

Similar Threads

  1. Two Instance in One Page Browser using IFrame
    By gani in forum Client SDKs
    Replies: 1
    Last Post: May 19th, 2010, 09:26 AM
  2. On addTable() receveiving updates from previous group
    By jakov.semenski in forum Client SDKs
    Replies: 3
    Last Post: November 26th, 2008, 05:14 PM
  3. IG Group's cool applications
    By Alessandro in forum General
    Replies: 6
    Last Post: July 1st, 2008, 02:26 PM
  4. filter/query
    By jamesclinton in forum Client SDKs
    Replies: 2
    Last Post: April 16th, 2007, 12:54 PM
  5. Adding/Removing item in subscribed group
    By rsouissi in forum Adapter SDKs
    Replies: 4
    Last Post: January 10th, 2007, 06:11 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 08:34 PM.