aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/vaadin/data/util/IndexedContainer.java5
1 files changed, 5 insertions, 0 deletions
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;