From: Artur Signell Date: Mon, 1 Mar 2010 15:21:36 +0000 (+0000) Subject: #4170 - IndexedContainer.addItemAfter(null, Object) does not work X-Git-Tag: 6.7.0.beta1~2014 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7fc1c4c0d18680ba34e8f0cb779d91e12742ee3a;p=vaadin-framework.git #4170 - IndexedContainer.addItemAfter(null, Object) does not work svn changeset:11565/svn branch:6.3 --- diff --git a/src/com/vaadin/data/util/IndexedContainer.java b/src/com/vaadin/data/util/IndexedContainer.java index f5dddf5e23..3d4a98fb97 100644 --- a/src/com/vaadin/data/util/IndexedContainer.java +++ b/src/com/vaadin/data/util/IndexedContainer.java @@ -548,6 +548,11 @@ public class IndexedContainer implements Container.Indexed, * java.lang.Object) */ public Item addItemAfter(Object previousItemId, Object newItemId) { + // Adding an item after null item adds the item as first item of the + // ordered container. + if (previousItemId == null) { + return addItemAt(0, newItemId); + } // Get the index of the addition int index = -1;