| Summary: | [Table][Tree] Items structure out of sync when disposing non-materialized item | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ivan Furnadjiev <ivan> | ||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P2 | CC: | abdelilah.nizari, jboehme, mknauer, tbuschto | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 2.1 M2 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | protocol | ||||||
| Attachments: |
|
||||||
|
Description
Ivan Furnadjiev
Created attachment 227796 [details]
Patch against Controls Demo -> Table Tab to reproduce the issue
Steps to reproduce:
1. Patch the Controls Demo with the attached patch
2. Start Controls Demo -> Table Tab
3. Check VIRTUAL checkbox
4. Change the itemCount to 150
5. Fast scroll to the end of the table - the idea is to keep items 100, 101 and 102 non-materialized
5. Click on the button "Dispose items 100, 101, 102"
"..." items appear on the screen and the items structure on the client is different from the server.
Currently we render the "index" property of the item only in item creation. The solution will be to render this property every time it changes. This will allow as to reorder the materialized items on the client and to keep the items structure in sync. Probably same happens if you call one of the Table/Tree remove by index methods on non-materialized items. We've found an additional case that seems to be very similar to this one.
Given a virtual table viewer with some content. Then the user scrolls down the table and additional items are shown.
Now... we set new content into the table (tableViewer.setIntput(newContent)). The expected behaviour is that the old table content is reset/removed and replaced by the new content, i.e. the table doesn't show any old entries. But the actual behaviour shows the old entries when scrolling down until they are replaced ('virtal') by the new entries.
I'd prefere to render createItem->disposeItem in one response. Otherwise we'd have to re-render the index on ALL resolved+shifted items! Plus, this solution requires no client or protocol changes. We will solve this by rendering index again if it changes. Implemented setIndex on GridItem.js with commit fa87eb10cbcad4c9d7929cb07ef797cfc76aa788. Add Tree/Table item index preserve/render with commit df326569171998487724d52141411fc3d02522a9. I found a problem with the current fix: - item index property is not rendered if TableItem was cleared (see TableItem#renderChanges) (In reply to comment #9) > - item index property is not rendered if TableItem was cleared (see TableItem#renderChanges) Fixed in master with commit 97a6ea18d57e03b09469572932048fc4130209fc. |