diff options
author | Henri Sara <henri.sara@itmill.com> | 2011-11-22 14:16:09 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2011-11-22 14:16:09 +0000 |
commit | f6a57e1d40de2728d1650a6060e58c19407d0aef (patch) | |
tree | 1c4c02d883f11dc543463aceab2f7a4f802f6f3c /src/com/vaadin/ui | |
parent | 7d5095873a588d6427cd6f41087d205f1a9106e5 (diff) | |
download | vaadin-framework-f6a57e1d40de2728d1650a6060e58c19407d0aef.tar.gz vaadin-framework-f6a57e1d40de2728d1650a6060e58c19407d0aef.zip |
#7972 drop on table should work also when page length is zero
svn changeset:22097/svn branch:6.7
Diffstat (limited to 'src/com/vaadin/ui')
-rw-r--r-- | src/com/vaadin/ui/Table.java | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index c16505e57f..b95d738157 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -3802,8 +3802,8 @@ public class Table extends AbstractSelect implements Action.Container, * <p> * Note, that some due to historical reasons the name of the method is bit * misleading. Some items may be partly or totally out of the viewport of - * the table's scrollable area. Actully detecting rows which can be actually - * seen by the end user may be problematic due to the client server + * the table's scrollable area. Actually detecting rows which can be + * actually seen by the end user may be problematic due to the client server * architecture. Using {@link #getCurrentPageFirstItemId()} combined with * {@link #getPageLength()} may produce good enough estimates in some * situations. @@ -4534,19 +4534,14 @@ public class Table extends AbstractSelect implements Action.Container, * com.vaadin.event.dd.acceptcriteria.AcceptCriterion#accepts(com.vaadin * .event.dd.DragAndDropEvent) */ + @SuppressWarnings("unchecked") public boolean accept(DragAndDropEvent dragEvent) { AbstractSelectTargetDetails dropTargetData = (AbstractSelectTargetDetails) dragEvent .getTargetDetails(); table = (Table) dragEvent.getTargetDetails().getTarget(); - ArrayList<Object> visibleItemIds = new ArrayList<Object>( - table.getPageLength()); - visibleItemIds.size(); - Object id = table.getCurrentPageFirstItemId(); - for (int i = 0; i < table.getPageLength() && id != null; i++) { - visibleItemIds.add(id); - id = table.nextItemId(id); - } - allowedItemIds = getAllowedItemIds(dragEvent, table, visibleItemIds); + Collection<?> visibleItemIds = table.getVisibleItemIds(); + allowedItemIds = getAllowedItemIds(dragEvent, table, + (Collection<Object>) visibleItemIds); return allowedItemIds.contains(dropTargetData.getItemIdOver()); } |