Results 1 to 2 of 2
  1. #1

    Removing, replacing ItemUpdate positions

    Hello LightStreamer team. In the android app i am developing, there is an option to replace and delete stocks from the UI. When those values are changed after the first subscription, I have to update the adapter to send me correct ItemUpdate positions. The problem am facing is with the graphs update. For setting the new itemUpdate positions first I have to unsubscribe and register the observer again, which is causing redrawing of the graphs once again when ls.Client.subscribe() is called. I tried the setItems method, but it also requires unsubscription, so the result is the same. Is there some way to update the correct positions without unsubscribing? The adapter is set in DISTINCT mode

    Despite of my problem everything is working amazing, great job and sorry if the question is already asked, I couldn’t find similar issue in the forum

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

    Unfortunately I have to confirm that it is not possible to change the position in ItemUpdate without perform an unsubscribe (followed by a new subscribe).
    Indeed, although I didn't know so much about your application, I am not sure if the chosen subscription mode is the better one to feet the UI requirements.
    Generally, in cases where the items requested by the client may vary continuously over time, there are two favored subscription strategies:

    - A single Item in COMMAND mode, where the list of subscribed stocks is updated directly with special updates from the server;
    - multiple Items in DISTINCT or MERGE mode subscribed to with different subscribe calls. This allows you to add and remove stocks separately without affecting the other subscriptions.

    I am inclined to the second option for your case, you can also refer to this demo that does something similar: https://demos.lightstreamer.com/GridDemo/

    Please let us know if you have already considered these subscription options and if you need any further clarifications.

    Regards,
    Giuseppe

 

 

Similar Threads

  1. Adding or Removing Subscriptions
    By subuta in forum Client SDKs
    Replies: 4
    Last Post: December 27th, 2011, 04:03 PM
  2. itemUpdate.getNewValue throws strange exception
    By mnenchev in forum Client SDKs
    Replies: 1
    Last Post: October 28th, 2010, 10:36 AM
  3. Adding/Removing items dynamically
    By Otake in forum Client SDKs
    Replies: 5
    Last Post: December 17th, 2009, 03:15 PM
  4. Adding/Removing item in subscribed group
    By rsouissi in forum Adapter SDKs
    Replies: 4
    Last Post: January 10th, 2007, 07: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 09:33 AM.