replace a model for container (list/combobox)

I want to create a combobox or list using some predefined Model object, like you’d do it in Java Swing.
I’m trying to use the approach described here:
http://vaadin.com/book/-/page/datamodel.container.html

BeanContainer<String, Bean> beans =
new BeanContainer<String, Bean>(Bean.class);

my question is: is there a way to replace a model for an existing UI element? say, create 1 combobox and then switch its model as needed?

ok, I found the answer. you can set / replace the model using setContainerDataSource() method even after the UI element (Combobox in my case) is created:

    BeanContainer<String, Bean> beans =
        new BeanContainer<String, Bean>(Bean.class);
    beans.setBeanIdProperty("name");

 // Add some beans to it
    beans.addBean(new Bean("Other container bean",   130.0));
    myCombobox.setContainerDataSource(beans);