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

Bug 384589

Summary: [CellEditor] Wrong row is edited when last row is visible
Product: [RT] RAP Reporter: David Song <micromms>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: artjomka.mail, christophe.desfourneaux, eclipse, francis_delsinnes, hangum, ivan, rgransberger, roger.godbout
Version: 1.5Flags: ivan: review? (rsternberg)
Target Milestone: 2.0 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard: sr151
Attachments:
Description Flags
sample code
none
error occurs when table is layouted in not the first tab of the widget tabFolder none

Description David Song CLA 2012-07-09 06:05:35 EDT
Build Identifier: Version: Indigo Service Release 2 Build id: 20120216-1857

When I try to edit the last rows in the tableViewer, the wrong rows are edited!
in RAP 1.5.0.20120612-1458

Reproducible: Always
Comment 1 David Song CLA 2012-07-09 06:06:41 EDT
Created attachment 218435 [details]
sample code
Comment 2 Ivan Furnadjiev CLA 2012-07-09 07:00:08 EDT
Thanks for the snippet. I can reproduce it - when last row is visible the problem exists on all rows on the screen.
Comment 3 Ivan Furnadjiev CLA 2012-07-09 07:42:23 EDT
Change priority to P1 as it is a regression - works fine in 1.4. This is not only a problem to CheckboxCellEditor. It is valid for all cell editors. The new value is applied on a wrong item.
Comment 4 Ivan Furnadjiev CLA 2012-07-09 07:46:57 EDT
BTW... it is reproducible with Controls Demo -> TableViewer tab too:
1. Click on "Add 100 items" button
2. Click on "Create Cell Editor" button
3. Scroll-down to the end - last row is visible
4. Click on "new 110" to activate the cell editor - the value in the editor become "new 109" instead of "new 110"...
5. Change and apply the value - the item 109 is modified
Comment 5 Ivan Furnadjiev CLA 2012-07-09 10:26:08 EDT
The problem was in Table#adjustTopIndex where 1 was subtracted all the time. Fixed with commit aeaa27121bed8e306ea6dcab0d9710e5a98af290. Propose to backport the fix to 1.5 maintenance branch.
Comment 6 David Song CLA 2012-07-09 22:32:31 EDT
I just fixed with commit aeaa27121bed8e306ea6dcab0d9710e5a98af290 and test it in my Juno (Version: Juno Release Build id: 20120614-1722) on windows 7 64bit, but the error still exists, I test the snipet above and it runs ok, but in my project the error is no changes.I am puzzled why the last row is not invisible in the snippet above but it is visible in my project(BTW my app has Chinese data provider and  runs on Chinese Language Platform). And when the last row is invisible,the error occrors.
Comment 7 Ivan Furnadjiev CLA 2012-07-10 02:10:53 EDT
(In reply to comment #6)
> I just fixed with commit aeaa27121bed8e306ea6dcab0d9710e5a98af290 and test it
> in my Juno (Version: Juno Release Build id: 20120614-1722) on windows 7 64bit,
> but the error still exists, I test the snipet above and it runs ok, but in my
> project the error is no changes.I am puzzled why the last row is not invisible
> in the snippet above but it is visible in my project(BTW my app has Chinese
> data provider and  runs on Chinese Language Platform). And when the last row is
> invisible,the error occrors.

Probablym your project is using different bundles (target). Check if your project is using the patch bundle.
Comment 8 David Song CLA 2012-07-10 10:14:03 EDT
I retest the snipet, and another error occurs, the table's header disappear when it layouted not in the first tab of the widget tabfolder!
Comment 9 David Song CLA 2012-07-10 10:15:31 EDT
Created attachment 218503 [details]
error occurs when table is layouted in not the first tab of the widget tabFolder
Comment 10 Ivan Furnadjiev CLA 2012-07-10 10:21:56 EDT
(In reply to comment #8)
> I retest the snipet, and another error occurs, the table's header disappear
> when it layouted not in the first tab of the widget tabfolder!

Song, I don't think that this issue is related to the current problem. Please open a separate bug and attach a snippet to reproduce it there. Thanks.
Comment 11 Ivan Furnadjiev CLA 2012-07-10 11:57:14 EDT
Fixed the same issue in Tree with commit d0c0578c49835bd2f8c5655c0a1aad71bec4ffc1.
Comment 12 Ivan Furnadjiev CLA 2012-07-13 08:07:28 EDT
*** Bug 385036 has been marked as a duplicate of this bug. ***
Comment 13 Ivan Furnadjiev CLA 2012-07-18 05:36:34 EDT
*** Bug 385387 has been marked as a duplicate of this bug. ***
Comment 14 Ralf Sternberg CLA 2012-09-05 11:44:21 EDT
I think this is low risk, but a valuable fix. The fix did not have any side effects in master, so I agree, we should backport it to 1.5.
Comment 15 Ivan Furnadjiev CLA 2012-09-07 03:54:44 EDT
Backport the fix for both Tree and Table to 1.5 maintenance branch with commit 9ba5b70d93b8bdfc46b78009c6e2ad6dfae5ec48.
Comment 16 Artem Golovnya CLA 2012-09-11 09:49:51 EDT
*** Bug 389242 has been marked as a duplicate of this bug. ***
Comment 17 Christophe Desfourneaux CLA 2012-10-17 10:01:48 EDT
Hi,

My environnment is : Eclipse Juno SR1 with RAP 1.5.1 runtime

I can reproduce the bug by doing the following steps with the sample code provided by David Song :
1. Launch the RAP application
2. Click on the vertical scroll bar in order to display the bottom of the table viewer.
3. Increase the height of the viewer window until we see an almost complete empty row in the bottom of the table viewer.
4. Increase the height of the viewer just a little bit more : this time, the empty row disappears.
5. Click on the vertical scroll bar in order to make the empty row visible.
6. Click on a checkbox : the checkbox above is selected instead of the clicked one.

Do you want me to open a new bug ?

Best regards,
Comment 18 Ivan Furnadjiev CLA 2012-10-17 13:49:05 EDT
(In reply to comment #17)
> Hi,
> 
> My environnment is : Eclipse Juno SR1 with RAP 1.5.1 runtime
> 
> I can reproduce the bug by doing the following steps with the sample code
> provided by David Song :
> 1. Launch the RAP application
> 2. Click on the vertical scroll bar in order to display the bottom of the
> table viewer.
> 3. Increase the height of the viewer window until we see an almost complete
> empty row in the bottom of the table viewer.
> 4. Increase the height of the viewer just a little bit more : this time, the
> empty row disappears.
> 5. Click on the vertical scroll bar in order to make the empty row visible.
> 6. Click on a checkbox : the checkbox above is selected instead of the
> clicked one.
> 
> Do you want me to open a new bug ?
> 
> Best regards,

Christophe, from your description it looks like the same issue. Please reopen this bug and I will check it as soon as possible.
Comment 19 Ivan Furnadjiev CLA 2012-10-17 14:14:20 EDT
Christophe, just checked Controls Demo -> TableViewer Tab with cell editors activated and I can't reproduce it. Maybe I can't follow your steps exactly.
Comment 20 Christophe Desfourneaux CLA 2012-10-18 06:54:51 EDT
Ivan, I cant't reproduce the issue with Control Demos -> tableviewer (neither 1.5.1 nor 2.0M2).
There's problably something wrong in "sample code" and in my own application. If I change the style of tableViewer from SWT.SINGLE|SWT.BORDER|SWT.H_SCROLL|SWT.V_SCROLL|SWT.FULL_SELECTION to SWT.NONE in my application/sample code, the problem disappears. Please don't waste your time on this issue. If I find more information, I will post comment. Thanks for your help.
Comment 21 Cho HyunJong CLA 2013-01-19 23:28:13 EST
2.0 RC1 same exception.
Comment 22 Ivan Furnadjiev CLA 2013-01-20 03:31:32 EST
(In reply to comment #21)
> 2.0 RC1 same exception.
Could you attach a snippet and step-by-step guide to reproduce it with RAP 2.0 RC1?
Comment 23 Cho HyunJong CLA 2013-01-20 13:57:19 EST
(In reply to comment #22)
> (In reply to comment #21)
> > 2.0 RC1 same exception.
> Could you attach a snippet and step-by-step guide to reproduce it with RAP
> 2.0 RC1?

i'm sorry. i mistakes. ㅜㅜ
Comment 24 rgra Missing name CLA 2013-03-09 06:36:02 EST
It still happens for me with RAP 2.0 Final.

On my computer with Windows 7, Firefox 19.0.2 it works fine.

On another computer running Windows Server 2003 SP 2 and Firefox 18.0.1 and on a computer with Windows XP, running Firefox 19.0.2 the described error occurs when scrolling down in the table.

I will try to run the samples provided here and see if they are producing the same error on these machines, too. Otherwise I will try to create a new example to reproduce the problem.