vaadin / framework

Vaadin 6, 7, 8 is a Java framework for modern Java web applications.
http://vaadin.com/
Other
1.79k stars 729 forks source link

SQLContainer - table selection error #3228

Closed vaadin-bot closed 11 years ago

vaadin-bot commented 11 years ago

Originally by baseballrey14


Problem Using the com.vaadin.ui.Table component in multi-selection mode and the Vaadin SQLContainer results in incorrect element selection while quickly scrolling.

-*Test Case:** I have create a test application that is attached. The table is displayed on the left side of the split panel and the table's getValue() is displayed on the right side. To reproduce the error:

  1. Select an item in the table.
  2. Quickly scroll down with the mouse wheel about two page lengths.
  3. Shift select another value in the table.

It may take a few attempts, but occasionally two errors can occur.

  1. The values are deselected except for the 1st value. At this point you can scroll to the top of the table to see that the first n values are now selected. (n is the number of elements originally selected).
  2. The table's getValue() function returns the incorrect values. Similar to error #1, but the elements are not deselected, until the table is scrolled. (ie. getValue() returns [127,0,1,2] when [127,128,129,130] should have been returned.

This can also occur when:

  1. Quickly scroll down with the mouse wheel about two page lengths.
  2. Select a value in the table.

It may take a few attempts, but occasionally the value is highlight as if it is selected, but is quickly deselected. At this point you can see that the table's getValue() returns the value. (Even though it isn't highlighted). If you Ctrl select another item, the getValue() returns 2 items when only 1 item is highlighted.

This error occurs quite often, especially just before the SQLContainer's page limit. (200 in this example).


Imported from https://dev.vaadin.com/ issue #10376

vaadin-bot commented 11 years ago

Originally by baseballrey14


Attachment added: sqlcontainer-bug.zip (5606.4 KiB)

vaadin-bot commented 11 years ago

Originally by dosendoc


I've just prioritized this bug using a Pro account. The issue still exists in version 7.0.5.

vaadin-bot commented 11 years ago

Originally by dosendoc


Steps to reproduce this problem:

Let me know if you need more help with reproducing the issue.

vaadin-bot commented 11 years ago

Originally by @hesara


The root issue seems to be in SQLContainer.indexOfId(id), which only seeks in added items, on the current page and forward from the current page. In this case, it is called for an item that is before the current page.

vaadin-bot commented 11 years ago

Originally by @hesara


Fix implemented for 6.8 branch (to be merged to 7.x).

vaadin-bot commented 11 years ago

Originally by @hesara


See #11849 for merge to Vaadin 7.0.