Scaladin & BeanContainer

I am trying to port the following code from Java to Scaladin 3.x to populate a ComboBox. Can anyone suggest the correct implementation?

        _cbxAssociation.setContainerDataSource(new BeanContainer<Integer, Association>(Association.class) {
            {
                setBeanIdProperty("id");
                asDatabase oDatabase = asApplication.getInstance().getDatabase();
                String strOrderBy = "NAME";
                List<Association> lstAssociations = oDatabase.executeQuery(Association.class, false, null, strOrderBy);
                for (final Association oAssociation: lstAssociations) {
                    addBean(oAssociation);
                }
            }
        });

I’ve started with:

    container = new BeanContainer[Int, Association]
(classOf[Association]
) {
    }

but container expects a vaadin.scala.Container not a com.vaadin.data.util.BeanContainer

Any examples of scaladin working with comboboxes and containers?

[quote=Peter Hancox]

    container = new BeanContainer[Int, Association]
(classOf[Association]
) {
    }

[/quote]As a further complication the parameter passed to the BeanContainer constructor needs to be the class of a mixin. i.e., (classOf[Association with SurrogateIntId]
) due to the way my ORM layer (mapperdao) works.

Unfortunately classOf[…]
won’t accept a mixin. Perhaps someone whose scala knowledge is greater than mine could provide some assistance?

Otherwise this all looks like becoming a bit of a mess and it might be better to avoid use of Bean Container entirely unless someone’s done this before.

After battling with various Java/Scala compatibility issues the following is the best I’ve come up with:

p.setContainerDataSource(new BeanContainer[Int, Association] (classOf[Association] ) { val associations = associationDao.all associations foreach { association => addItem(association.id, association) } }) Had to use “addItem(…)” and manually extract the “id” property from the bean instead of “addBean(…)” to work around the issue where "classOf[…]
" couldn’t be used with a mixin.

And had to fallback to using “p.setContainerDataSource(…)” instead of just “container =”. Is there any way to use the Scaladin approach of “container =” to assign the BeanContainer instance?