diff options
author | Henri Sara <henri.sara@itmill.com> | 2010-03-11 15:29:42 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2010-03-11 15:29:42 +0000 |
commit | 34f26e6711bba490f656000d1042e7ddd91b8f9e (patch) | |
tree | 6d1261c674267eddbdb41920d6365aba7ee7ab52 /src/com/vaadin/data/util | |
parent | efd5721cf3ff0ac27ad0527d72bdfa14c2252328 (diff) | |
download | vaadin-framework-34f26e6711bba490f656000d1042e7ddd91b8f9e.tar.gz vaadin-framework-34f26e6711bba490f656000d1042e7ddd91b8f9e.zip |
#4303 BeanItemContainer.addItem(null, Object) did not respect contract
svn changeset:11794/svn branch:6.3
Diffstat (limited to 'src/com/vaadin/data/util')
-rw-r--r-- | src/com/vaadin/data/util/BeanItemContainer.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/vaadin/data/util/BeanItemContainer.java b/src/com/vaadin/data/util/BeanItemContainer.java index f0d806204f..3e3c4a5538 100644 --- a/src/com/vaadin/data/util/BeanItemContainer.java +++ b/src/com/vaadin/data/util/BeanItemContainer.java @@ -258,7 +258,9 @@ public class BeanItemContainer<BT> implements Indexed, Sortable, Filterable, public BeanItem<BT> addItemAfter(Object previousItemId, Object newItemId) throws UnsupportedOperationException { // only add if the previous item is visible - if (containsId(previousItemId)) { + if (previousItemId == null) { + return addItemAtInternalIndex(0, newItemId); + } else if (containsId(previousItemId)) { return addItemAtInternalIndex(allItems.indexOf(previousItemId) + 1, newItemId); } else { |