Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 276051 - [Table] Wrong selection behavior with Shift-click on empty selection
Summary: [Table] Wrong selection behavior with Shift-click on empty selection
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-13 05:48 EDT by Ralf Sternberg CLA
Modified: 2014-05-13 05:23 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Sternberg CLA 2009-05-13 05:48:46 EDT
Steps to reproduce:
* Use a table with MULTI style
* Dispose selected table item(s) -> the selection is empty
* Select a row by clicking *and* pressing the Shift key

The result is either:
* the row is not shown as selected
* an arbitrary range is selected
(this seems to depend on the current state of the variable Table#_focusIndex)

Expected:
the clicked row should be selected
Comment 1 Ivan Furnadjiev CLA 2009-05-13 06:10:45 EDT
This bug is related to bug 235583. The patch about focusIndex synch is attached to the bug too.
Comment 2 Ralf Sternberg CLA 2009-05-14 06:09:46 EDT
Fixed in CVS HEAD.
Applied patch from bug 235583 with an addition to select the single row in the scenario described above.
Comment 3 Jordan Yakovchev CLA 2009-05-18 06:03:59 EDT
This bug should be reopened because there is another scenario to reproduce similar problem.

Steps to reproduce:
1. In the control demo select TableViewer tab.
2. Check MULTI button.
3. Click the button "Select youngest Person"
4. While holding SHIFT key cklick with mouse over the 4th item
5. Both first and fourth items become selected
6. Click "Select youngest Person" again
7. While holding SHIFT key cklick with mouse over the 7th item
8. Now items 4th to 7th are selected and also the first item.

This problem is observed also in table widget, but appears on step 7.
Comment 4 Ivan Furnadjiev CLA 2009-05-18 06:22:15 EDT
Reopen.
Comment 5 Ralf Sternberg CLA 2009-05-18 09:40:21 EDT
Fixed in CVS HEAD.
The focusIndex was overridden by reading the selection in TableLCA#readData. Exchanging the order of readFocusIndex and readSelection fixed the problem.
Comment 6 Ralf Sternberg CLA 2009-05-19 05:18:56 EDT
The problem is solved for the Table but persists for the TableViewer, which calls Table#select() instead of Table#setSelection().
In this case, the focusIndex is not updated. Further investigation required.
Comment 7 Tim Buschtoens CLA 2011-06-09 10:25:24 EDT
Seems the new Table does not fix the problem, but possibly changed it. Now it seems there is no focused item until an item has been clicked, selected or not. Table is fine though, only TableView has the problem. Needs further investigation.
Comment 8 Ivan Furnadjiev CLA 2011-12-23 04:43:53 EST
There was a similar problem with the focused item - Bug 366385. We found that RAP and SWT behaves the same in despite of it is not expected. There are two methods to set the selection in TableViewer - with or without reveal. If "reveal" is true than Table#setSelection is used which moves the focused item. If "reveal" is false than Table#select is used and the focused item is not moved.
Comment 9 Ivan Furnadjiev CLA 2014-05-13 05:23:05 EDT
I can't reproduce it anymore with RAP 2.3M3 and the behavior in RAP and SWT is the same (comment#8). Close as fixed.