Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Dec 2008
    Location
    Karlsruhe
    Posts
    7

    Post Problem with table clearing when using "showValues" for "DynaScrollTable"

    While working on a problem with a "DynaScrollTable" (as described in a separate thread) we ran into another problem with the "showValues()"-function and clearing of the data table.

    We use the "showValues()"-function to populate the "DynaScrollTable" with initial values after page load. This worked great, the page loads with an empty "DynaScrollTable", then the table gets populated with highlighting (Hot/ColdPhase) with the latest 10 entries (written into a <script>-block by the webserver), and afterwards new updates get pushed by the Lightstreamer..

    While working on our original problem I noticed that the particular website still used a heavily outdated version of the web client library (build 1313), so we switched to the newest library build (1355.3) to see if our initial problem had been fixed in the newer version - unfortunately it did not help with our problem, but instead we noticed an additional problem with the newer library build - right after the "DynaScrollTable" was populated by the "showValues()"-calls the whole table got cleared, and then slowly filled when normal updates were received.

    There's a "setClearOnAdd()"-method in the "VisualTable"-class, and the default is to clear every table after a call to "PushPage.addTable()", but our JavaScript-code explicitely sets "myDynaScrollTable.setClearOnAdd(false)" before the "addTable()"-call, so that should be alright.

    The documentation mentions an exception for some data tables:
    Some kinds of data tables require that the screen table is cleared before displaying data coming from the data table. This applies to DynaScrollTable, MetapushTable, DynaMetapushTable and MultiDynaMetapushTable. With data tables of these kinds, this setting is ignored and the screen table contents are always cleared upon reuse of a screen table for such a data table.
    As we use a "DynaScrollTable" this exception is relevant in our case, but I still don't understand why the behaviour is different between the different build numbers of the web client library. I looked through the Changelog, and the only comment I found related to "setClearOnAdd" was this:

    4.3 build 1346
    [...]
    Fixed a bug that might prevent screen table reuse from working correctly.
    A second addTable call on the same table ID could throw an exception in case
    some cell was dynamically removed in the meantime and one of
    setClearOnAdd/Remove/Disconnected was called with true.
    As we only do a single call to "addTable()" I don't think this bugfix affects our use case.

    Our relevant Javascript-code looks like this (a little bit simplified):


    I don't really have an explanation why the table gets cleared after being populated via "showValues()" when we use the new version of the webclient library (build 1355.3) and why it does not happen with the old version (build 1313).

    The calls to "showValues()" are executed only after the table has been brought into the "running" state by the "addTable()"-call, so the clearing of the data table should already have happened according to the documentation on "setClearOnAdd()" - or am I mistaken?

    Do I have to put the "showValues()"-calls into a "myDynaScollTable.onStart()"-function? The documentation for "onStart" says that...
    [...] In case of a VisualTable, the cleaning of the visual table content has already been performed, according with the VisualTable.setClearOnAdd(), VisualTable.setClearOnRemove() and/or VisualTable.setClearOnDisconnected() settings.
    Would this mean that the calls to "showValues" will be executed later than they are now? We try to populate the data table with the initial data as quickly as possible, so I would like to prevent any additional delay..

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Admittedly, there was a change, but it was considered as an internal change with no practical effects. Now, your case exploits the difference.

    To resume, the table clearing associated with an addTable invocation, in case the Engine were currently disconnected, was deferred until the first connection.
    With Server-originated updates nothing has changed. Even in case of reuse of the same table with removeTable + addTable, you can cause the old table contents to be cleared as early as possible through setClearOnRemove, whereas, through setClearOnAdd, you can cause the old table contents to be cleared as late as possible.

    However, your showValues occur after addTable and before the connection takes place and this now causes them to be cleared. Only performing the calls upon onStart would work.
    We acknowledge that your use of showValues makes sense and will try to restore the original behavior. Sorry for the inconvenience.

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Hi Andreas,
    The new release has been issued, but the discussed change couldn't be included,
    as it was deferred until a thorough refactoring of the topic is finally performed.
    If you are still bound to this change, we can provide you with a private update, when available.

  4. #4
    Member
    Join Date
    Dec 2008
    Location
    Karlsruhe
    Posts
    7

    Hey Dario,
    thanks for the update, I'll keep it in mind - seeing as the new release promises quite a lot of optimizations (both on the server and on the client side) I'd really like to deploy and use it as quickly as possible, so I'll check with the project in question if we can implement the call to "showValues()" in the "onStart()"-event for the time being. Nevertheless, I'd really appreciate it if you could give me an update when you've had the time to refactor the functionality, so we have a chance to evaluate the updated version.

    By the way, congratulations to the new version! Just read through the release eMail and had a quick look over the detailed release notes - sounds really interesting, and I really like that you've added the option to keep the global Javascript namespace "clean" by grouping all the Lightstreamer functionality within the "Lightstreamer" namespace (by calling avoidLSGlobals).

    Cheers,
    Andreas

 

 

Similar Threads

  1. Replies: 1
    Last Post: July 10th, 2012, 07:06 PM
  2. Replies: 2
    Last Post: March 1st, 2012, 02:53 PM
  3. Replies: 7
    Last Post: June 7th, 2010, 10:38 AM
  4. Formatting of unchanged values in "DynaScrollTable"
    By hofmanna in forum Client APIs
    Replies: 5
    Last Post: January 14th, 2010, 11:02 AM
  5. Replies: 1
    Last Post: September 18th, 2009, 10:13 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 10:23 AM.