If the data is arriving so fast, how do you expect the user to evaluate it, regardless of how it is displayed?
I completely agree with you, but the answer to this of the collegues for who I am developping the application says : "Maybe, but it works with the old VB6 version, so it should work with your new version"
Maybe you can filter the changes ( are there duplicates in the data )?
Another strategy is to batch the changes. Make a change no more often than say once every second or couple of seconds, or.. If you have a queue of 100 changes, do them all together.
What I am trying to do is to read data in a separate worker, and then get the received messages every second, but even if I use registerClassAlias, I am losing the types of the objects sent (I use getSharedProperty).
How can I make sure to keep the type of the object ?
If you know what the object type is, you can cast it. If not you might wrap it inside another object that includes the object class name.
I haven't used workers, so I have no other suggestions.
I managed to cast it by adding [RemoteClass(alias="package.className")] in the object I use. So I can now receiv my data and buffer it in a worker. But the application still freezes when 600 lines are present, and when I make several removes.
Your case is rather unusual, to say the least, and bordering on the absurd.
You have 600 lines present, but they change multiple times every second. It sounds a bit like watching the windows process manager.
You can't read 600 lines at once and you can't scroll reliably either because the underlying data that you are seeing is changing all the time.
Probably what I might do is only have a grid that is as large as can fit on your page. Make the underlying data source only have as many rows as can be seen. Ditch the scrollbars for your grid.
Have a separate scrollbar to page content, or use tabs.
Maintain your incoming data manipulations in an Array or Vector. If you have 50 lines in your datagrid, copy 50 entries into a seperate array and use that as the datasource for the datagrid. Change the data in the datasource array according to updates received or paging via the scrollbar/tabs.
This should greatly reduce the load on the datagrid and screen refresh.
Before incorporating it into your app, build a test app and test the performance.
Thanks for your suggestion, I will try to do it like that. I'll let you know what the result will be.
I've implemented this solution into my app, and it runs correctly now for this special overload case, so it will also work for a normal flow of information. Great thanks for your help pauland
But using this solution, I'm facing a new problem, each time I refresh the screen (every 1 sec), I lose the selected lines. Do you have an idea how i could "restore" the selection after a refresh ?
Big thanks again for your help !
Since the selected lines will change as the content changes, you'll need to remember the key for any selected line, before refreshing. By key, I mean a unique identifier, other than the position in the array.
Remember the selected keys, refresh the display, search for selected keys and select the row again.
Thank you so much !!
I've implemented all your solution, and it works well now,
Excellent - good job!