Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Not null, but empty BeanItemContainer should raise exception?

Bruno Freitas
1 decade ago Mar 26, 2010 2:51pm
Joonas Lehtinen
1 decade ago Mar 27, 2010 10:57pm

BeanItemContainer needs somehow know the class of the objects in the collection. If the collection is empty there is no instance to inspect. If you want to create an empty container, construct BeanItemContainer with BeanItemContainer(Class<? extends BT> type) constructor and add the beans to the container with addBeanAt(..)