| Summary: | [Tree] Setting tree top item at creation time does not work | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Jens Borrmann <jens.borrmann> | ||||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | ivan | ||||||
| Version: | 2.3 | ||||||||
| Target Milestone: | 3.0 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
I can't reproduce it with RAP 3.1 M4. I think it has been fixed more that one year ago... Thanks for analyzing. Is a backport of the fix to 2.3 possible? Could you give a pointer to the fix in git? Unfortunatelly a lot of Grid.js code has been changed since than. I though that this is the change, which fixed it https://git.eclipse.org/r/#/c/20503/. But it's already included in RAP 2.3. ... just tried to reproduce it with RAP 2.3 maintenance branch and Controls Demo (with your patch applied) without success. Scrolling to the new top item works correctly there too. OK... Do you have only one item with a lot subitems? Did you try to set the topItem to one of the subitems? I think the fix in change https://git.eclipse.org/r/#/c/20503/ does not work for subitems. Same for 3.1 (master) and 2.3. Will try to reproduce it now against RAP master. Yes, in our use case we have a lot of items and hierarchies. And this is why being able to set the top item to the same position every time the user enters the UI would be very valuable. ... but I still can't reproduce it with our Controls Demo. Could you please create a small self-running snippet that demonstrate the issue. Which browser do you use? I can reproduce it with the inital patch on IE, FF and Chrome. But it works in the embedded browser in Eclipse... To me the problem seems to be in org.eclipse.swt.internal.widgets.treekit.TreeLCA.renderAfterItems(Tree, IRenderRunnable). lastItem should be searched for recursively for the whole (expanded?) tree, shouldn't it? (In reply to Jens Borrmann from comment #9) > To me the problem seems to be in > org.eclipse.swt.internal.widgets.treekit.TreeLCA.renderAfterItems(Tree, > IRenderRunnable). > > lastItem should be searched for recursively for the whole (expanded?) tree, > shouldn't it? That was my thought too, when I reopened the bug. Searching recursively for the whole (expanded?) tree is performance critical if you have too many nested levels. I've tested it in Chrome and Firefox with modified Controls Demo both in RAP 3.1M4(master) and 2.3 maintenance branch and can't reproduce it. That's why I need a simple entry point to demonstrate the issue. Created attachment 258838 [details]
Patch with many items for tree tab
Attached a new patch that _really_ reproduces the problem.
I created very many items - kind of Big Data... Maybe some of them are not really neccessary.
I did not manage to reproduce the bug for 3.1 but only for 2.3.
Thanks for the patch. Now I can reproduce it in 2.3-maintenance branch. Working on a fix. As this is not an issue with RAP 3.1 I will close this bug now again. |
Created attachment 258821 [details] Patch for controls demo that sets top item at creation time. Setting a top item when creating a tree does not work. The problem seems to be caused by an invalid ordering of operations. The JSON contains the following stream of events: ... - Create GridColumns - Create First GridItem - Set Properties to Grid (topItemIndex, scrollLeft, focusItems, selection) - Create Remaining GridItems ... When setting topItemIndex to the grid an attempt is made to find the element that is referenced by the index, which is obviously not possible before creating that item. Therefore no scrolling takes place. When manually rearranging the operations array in the debugger and setting topItemIndex after creating all items the scrolling worked for me. This also explains why setting top items works in the controls demo where the top item is set _after_ the UI was created.