]> source.dussan.org Git - vaadin-framework.git/commitdiff
#4170 - IndexedContainer.addItemAfter(null, Object) does not work
authorArtur Signell <artur.signell@itmill.com>
Mon, 1 Mar 2010 15:21:36 +0000 (15:21 +0000)
committerArtur Signell <artur.signell@itmill.com>
Mon, 1 Mar 2010 15:21:36 +0000 (15:21 +0000)
svn changeset:11565/svn branch:6.3

src/com/vaadin/data/util/IndexedContainer.java

index f5dddf5e2326e65234776f9bf3a6f0580c271c69..3d4a98fb97a8221cf0d1ad2dbac0e33e2a70e830 100644 (file)
@@ -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;