SQL Container and Multi-Select Table

I am having an issue with the Sql Container while trying to shift-select multiple items in a table. When I try to shift-select multiple items near the page limit the table will unselect all the items except for the first one selected.

When this happens, I have a debug statement in my getQueryStatement function that prints out my query. This is being executed multiple times when this happens. It executes for one side of the page limit and then the other.

For example:
I scroll down the table toward the page limit.
I select an item.
I shift select an item about 20 rows down.
The getQueryStatement prints out

select * from ( select a., rownum r from ( select * from table ) a ) where r between 1 and 200
select * from ( select a.
, rownum r from ( select * from table ) a ) where r between 201 and 400
select * from ( select a.*, rownum r from ( select * from table ) a ) where r between 1 and 200

Then it unselects everything except for the first item.
AND
it will select however many rows I selected, but it selects them at the very top of the table.

I have implemented the FreeformQueryDelegate and the FreeformStatementDelegate.

Is there anything I can do about this erratic behavior? The only other solution I can think of is to use a BeanItemContainer, because it’s lazy loading is much more reliable. However, I prefer the functionality of the SQL Container.

EDIT: I’m using vaadin 6.8.4.

EDIT: After further testing it appears that this behavior occurs throughout the container, not just near the page limit. If you select a value and then scroll the table down and shift select a value that is out of a certain range (the page cache range?) then it will select the wrong values in the table. This is only occurs in the SQLContainer. The bean container does a similar thing where it unselects all the rows, but if you request a repaint, the table still has the correct values and will still select the right values.

Is anyone else having this problem? At this point SQLContainer is unusable for me.

Also, when using the SQLContainer demo at http://demo.vaadin.com/sqlcontainer/simple - If you scroll down the table quickly and click on an item, sometimes it will “deselect” the item and other times it will look like you select an item, but won’t populate the side panel with any information. This table is in single select mode and the selection issue is very similar to the one I am having in my application. I plan on creating a ticket, but would appreciate any feedback.

New Ticket:

http://dev.vaadin.com/ticket/10376

I’m having the exact same problem. It’s pretty irritating for users when their selection jumps around.

I cannot find a configuration of SQLContainer and Table which avoids this problem, apart from disabling multi-select.

I tried to look into the source code to see where something might go wrong, but I’m somewhat overwhelmed by the sheer amount of code in Table and related classes. Is there any update concerning a fix for this?

EDIT: Actually, there is a configuration which avoids the issue. It does not occur in MultiSelectMode.SIMPLE. However, that isn’t really an acceptable workaround in this case, as the interface requires the user to select a large range of rows using the Shift key + click.

The problem should be fixed now and the fix will be in the next maintenance releases soon.