List.addItem() resets selected item
#1
I have found a bug? with addItem in that it resets the selected item when called.

I have a situation with a reasonably slow web service returning 500+ items taking a multiple seconds and want to split the process up into a batched approach of say 5 to 10 items at a time to allow the display of some items as soon as possible with this rest being added over time.

This will return the first 10 items and add them to the list then get the next 10 items and add them to the list. This might take a few seconds or a few minutes depending on the users setup.

The problem I am having is that the first items get added fine but the selected item is reset, I tried using the
selected = itemList.getSelectedPosition()
and then adding an item and setting the selection again with
itemList.selectItem(selected)
and that almost worked but once the page is full and you scroll down a bit weird stuff starts to happen. The list starts to scroll from top to bottom with each item add.

I have a simple window class with an example of this. The following link shows a simple window class that when displayed fills a List with ListItems one every 200 MS. When the page is full if you scroll down a page or so it will start the weird scrolling top to bottom.

https://github.com/faush01/MBCon/blob/ma...ayItems.py

So the question is is this a bug? Should addItem even reset the selected item in the first place.
Reply

Logout Mark Read Team Forum Stats Members Help
List.addItem() resets selected item0