BeanContainer and Pojo with Interface

Hi List,

maybe you can help me by giving fundamental hints.

In my application I defined Interfaces for all my Java Data Objects (they are not directly POJOs) and I try to work only with the Interfaces in the GUI.


BeanContainer<String, Translation> translationContainer = new BeanContainer<String, Translation>(Translation.class);


Table translationsTable = new Table(tableCaption, translationContainer);
translationsTable.setVisibleColumns(new Object[] { "language", "value" });

My problem is I always get exceptions the properties language and value are not available for the BeanContainer:

java.lang.IllegalArgumentException: Ids must exist in the Container or as a generated column , missing id: language

In case of the BeanContainer I was able to set a custom BeanIdResolver but the problems with the table remains.

Is there any way to use my interfaces in combination with BeanContainer.setBeanIdProperty and Table.setVisibleColumns?

Thank you in advance,

Hi List,

I found the problem. In my implementation the BeanContainer was not initialised when the Table was created. Therefore the getter/setter of the Interface were not found.

The answer for my question is: of course it is possible to use POJOs in combination with Interfaces.