diff options
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 { |