| Summary: | [table] Selecting multiple items sometimes doesn't work | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Stefan Röck <stefan.roeck> | ||||||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | major | ||||||||||
| Priority: | P2 | ||||||||||
| Version: | 1.0 | ||||||||||
| Target Milestone: | 1.2 RC1 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Stefan Röck
Created attachment 103542 [details]
snippet to reproduce the bug
Thanks for the snippet. Alternatively, the bug can be reproduced with the ControlsDemo: - Select "Table" tab - Select "MULTI" - add some items now follow the steps from the description Created attachment 111652 [details]
Preliminary bug fix
This patch synchronizes the server-side focusIndex with the client-side.
On the client-side, the focusIndex indirectly conrols the start-item of a multi-select (i.e. shift-click).
Calling one of the setSelection() methods sets the focusIndex to the first item. This is now propagated to the client-side and solves the problem.
Note that calling one of the select() methods does not change the focusIndex.
Comment on attachment 103542 [details]
snippet to reproduce the bug
obsolte, use new snippet
Created attachment 111773 [details]
Enhanced snippet to illustrate selection problem with table more clearly
The problem persists. I modified the test snippet to better reproduce the problem: - After clicking on one of the buttons "Load new list" or "Delete selected rows", the first record is selected on the table programmatically - The shell's caption always shows the current selection indices. The bug ocurrs after - Clicking on "Load new List" and then Shift-Click on one of the rows below, e.g. 15. (in about 2 of 3 attempts) or - Selecting several rows, e.g. 0-15, and then click on "Delete selected items". Now, sometimes NO item selection is shown although the selection was set programmatically. This bug appears to be fixed together with bug 276051. The above patch has been applied to CVS. Please feel free to reopen if you can still reproduce any of the problems described. Thanks for the fix, Ralf. Is it possible to provide a patch so that I can apply this fix to RAP 1.1.2, too? Or could you name all modified files? Thanks. (In reply to comment #8) > Thanks for the fix, Ralf. Is it possible to provide a patch so that I can apply > this fix to RAP 1.1.2, too? Or could you name all modified files? Thanks. The fix is a semantically equivalent version of the patch above (2nd attachment) with one addition in Table.js. The affected files are the same as affected by the patch. You could try to apply the patch directly to your version and add the following change to Table.js: In _multiSelectRowClicked, after var selectionStart = this._selectionStart !== - 1 ? this._selectionStart : this._focusIndex; if( selectionStart !== -1 ) { var start = Math.min( selectionStart, itemIndex ); var end = Math.max( selectionStart, itemIndex ); for( var i = start; i <= end; i++ ) { if( !this._isItemSelected( i ) ) { this._selectItem( i ); } } } Add this else branch: else { if( !this._isItemSelected( itemIndex ) ) { this._selectItem( itemIndex ); } } |