Results 1 to 5 of 5
  1. #1

    GWT CellTable ListProvider Patterns with Lightstreamer

    Hello,

    Is there an example on changing LightStreamer's GWT integration item update process from pushing out at the field change level (item/field/value pairing) to an item changed level, as I believe the LS server sends down in JSON sets.

    Basically I am trying to marry LS's integration piece with multiple GWT CellTables. The CellTables which are basically different views(filters) on the same master list which is being populated by LightStreamer.

    My thought was to have a Items Cache which is populated by LightStreamer, with a pup/sub process publish the changes to all the CellTable/ListDataProviders views. However, I am worried that the field level publication is going to break GWT's ListDataProvider's optimization to only repaint the CellTable's at the end of a current event block. In this case the event block seems like it would be at every field update.
    Last edited by flybyGWT; February 12th, 2014 at 03:10 PM.

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi flybyGWT,

    I confirm you that the Lightstreamer JavaScript Client library already handles the process of update at Item level.
    Please refer to this piece of code of our GWT demo:




    The event with which you are receiving an update is unique regardless of how many fields have changed for that Item. The object ItemUpdate allows you to navigate between fields that have actually undergone a change of value. At that point, as you have already noticed, our demo calls for each of these fields a single event to update the GWT FlexTable.

    To achieve your goal, you have to change this behavior, by updating your internal cache of the Item for every updated field and then passing to the CellTable the complete row with updated values.
    Something like this:



    By the way, I confirm you that the Lightstreamer server does not use JSON to send updates to the client, but a specific and optimized protocol.

  3. #3
    Quote Originally Posted by giuseppe.corti View Post
    Hi flybyGWT,

    I confirm you that the Lightstreamer JavaScript Client library already handles the process of update at Item level.
    Please refer to this piece of code of our GWT demo:




    The event with which you are receiving an update is unique regardless of how many fields have changed for that Item. The object ItemUpdate allows you to navigate between fields that have actually undergone a change of value. At that point, as you have already noticed, our demo calls for each of these fields a single event to update the GWT FlexTable.

    To achieve your goal, you have to change this behavior, by updating your internal cache of the Item for every updated field and then passing to the CellTable the complete row with updated values.
    Something like this:



    By the way, I confirm you that the Lightstreamer server does not use JSON to send updates to the client, but a specific and optimized protocol.

    Thank you for the reply. In the example you provided you would then on the GWT implementation side define the onItemUpdate(Ljava/lang/String make a call to the LightStreamer client cache with mySub.getItems(itemName) and then pass off the data to the various DataProviders?


    My thought was to use



    Then do field/value pair update -> GWT java bean updates though deferred binding field/value mapping package.


    In the case of having a super data set and multiple subData sets (views of the super set). Would you suggest having a separate subscription for each data set including the sub and suppers, or have the super set be the only subscriber which in client pub/sub down to the subDatasets? Or is there a even more efficient way build into LS already?
    Last edited by flybyGWT; February 13th, 2014 at 04:38 PM.

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi flybyGWT,

    Actually my example involved a client cache handled on GWT side.
    The "updateMyInternalCahce" method updates such a cahce for every changed field and the "onItemUpdate" informs the GWT side about which row needs the update.
    But I think that, in practice, it is not very different from your solution.

    As regards the management of the super data set and subs data sets, I confirm you that both solutions are fully supported by Lightstreamer. Choose which one is the best depends on the use cases of your application.
    For example if if all the data of the super set are displayed simultaneously or only a small portion and in this second case, the frequency of changes from a subs set into another.

    By the way, I know that it is not GWT but, please refer to this demo for an example of dynamic subsets subscription.

  5. #5
    Quote Originally Posted by giuseppe.corti View Post
    Hi flybyGWT,

    Actually my example involved a client cache handled on GWT side.
    The "updateMyInternalCahce" method updates such a cahce for every changed field and the "onItemUpdate" informs the GWT side about which row needs the update.
    But I think that, in practice, it is not very different from your solution.

    As regards the management of the super data set and subs data sets, I confirm you that both solutions are fully supported by Lightstreamer. Choose which one is the best depends on the use cases of your application.
    For example if if all the data of the super set are displayed simultaneously or only a small portion and in this second case, the frequency of changes from a subs set into another.

    By the way, I know that it is not GWT but, please refer to this demo for an example of dynamic subsets subscription.

    Thank you very much for your advice. I will also look into the dynamic subsets and see if I should build a GWT bridge to it.

 

 

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 05:33 PM.