What is refresh_from_data supposed to do in a recycle view?

58 views
Skip to first unread message

Leonard Gross

unread,
Oct 12, 2018, 3:56:15 PM10/12/18
to Kivy users support
The attached app illustrates some odd behavior.
On start-up the rv data  attribute is set and refresh_from_data is called.
Each row contains a TextInput widget, and all rows are correctly populated with "empty" So far so good.

Now, click on the first row, and modify the text to anything else, like "spam".
Then hit the "reset rv data" button, which reloads the original data into the rv and calls refresh_from_data.

One would expect to see the text input widgets reset to their original "empty" values, but instead the user modified value shows up in a  "random" row.  if you hit the "reset rv data" button several times, the text seems to bounce around.

Some widgets appear to be "re-used" with previous values. Seems to me some kind of "flush cache" is not being called. 

This problem showed up in a larger context where I was restoring values from disk, but this sample eliminates that as the cause.

--Len


blast100.zip

Leonard Gross

unread,
Oct 15, 2018, 6:30:59 PM10/15/18
to Kivy users support
Tito has explained the reason for this problem in another post.
See his  explanation of the caching behavior at https://github.com/kivy/kivy/issues/5989
Reply all
Reply to author
Forward
0 new messages