Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 427707

Summary: [Grid] Selection comes before creation events
Product: [RT] RAP Reporter: Ian Bull <irbull>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ivan
Version: unspecified   
Target Milestone: 2.3 M2   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Ian Bull CLA 2014-02-07 15:27:41 EST
I got the following set of operations from the RAP Server:

[SetOperation [getTarget()=w440, getProperties()=Properties [propertiesMap={focusItem=w461, selection=[w461]}]]]
[CreateOperation [type=rwt.widgets.GridItem, getTarget()=w458, ...] 
[CreateOperation [type=rwt.widgets.GridItem, getTarget()=w459, ...] 
[CreateOperation [type=rwt.widgets.GridItem, getTarget()=w460, ...]
[CreateOperation [type=rwt.widgets.GridItem, getTarget()=w461, ...] 

As you can see, the selection event (for w461) comes before the creation event for w461. This becomes tricky to handle. While I can queue this up, it's not clear if this is still relevant when the create operation finally comes (let's say the user has selected something else in the mean-time). Furthermore, because selection is actually an array, should we wait for some of the create events to come, all of the create events to come, or somehow handle appending the selection as they comes (keeping in mind that the user may also change the selection during the period).

Is it possible to change the logic and only fire selection events to the client for elements that have already been created?
Comment 1 Ivan Furnadjiev CLA 2014-02-08 04:32:05 EST
We had the same situation with topItemIndex, which is already fixed. We could use the same technique (in Tree/TableLCA#renderAfterItems) to render the selection after all items.
Comment 2 Ivan Furnadjiev CLA 2014-02-10 08:46:58 EST
Fixed with change https://git.eclipse.org/r/21745. Now Tree/Table selection/focus item/sort column are rendered after all items/columns operations.