Hello Maxim,
well, the problem is related to the invocation of GetViewForItem() in context of the OnLoadItem method. Conceptionally OnLoadItem is intended to take care of the pure loading process of the actual item only. Accessing other items during this update phase it not guaranteed to work correctly.
The list component is optimized to reuse existing items while the user is scrolling the list. You can imagine, after the user has scrolled the list, the update algorithm iterates through the actually existing item views and removes all the views which have become invisible arranging them at the opposite end of the list. Then the rearranged view is loaded with its new content (via OnLoadItem slot method).
Until this loop is done, the order of item views will change permanently. Moreover as long as the OnLoadItem has not been signaled for an item, the corresponding view may contain old contents. Therefore, depending on whether you are trying to access the view for an already updated item or an item still waiting for its update, the methhod GetViewForItem() may return the corect wrong value.
In other words, since it is not possible to load all items at once atomically, some of the items are already up to date while other are still waiting for the update. Accessing these not updated items with GetViewForItem() will inevitable lead to a wrong returned value.
I have updated our online documentation pointing out, that GetViewForItem() is not intended to be used in context of OnLoadItem.
Additionally I have put this issue on our to-do list. We will discuss how to proceed with this problem. Probably, we will add some error handling, so GetViewForItem() can detect which items are already up-to-date and valid and which items are still unsure. Accessing such 'unsure' item will return null.
Well, I have no workaround for you. You should avoid using GetViewForItem() in context of OnLoadItem. Please see also Access list items and views,
Best reagrds
Paul Banach