Commit() on BeanFieldGroup doesn't work

Hi All,

I have the following code :

BeanFieldGroup formController = new BeanFieldGroup(OrderBean.class);
formController.setBuffered(true);
formController.setItemDataSource(orderBean);

I call the method formController.commit() but the data in my model object don’t change.
Any suggestion ?
Cheers.

             Stefano

Hi All,

I create dinamically some UI components and I use the method :

formController.buildAndBind();

Is it right ?
Cheers.

            Stefano

Hi Stefano,

it seems to be right. Check your bindings are correct by prefilling your orderBean with some test values.
Also you could look if your fieldGroup.commit() throws a CommitException (your bean is not valid with the values).

By the way if a vaadin guy reads this:
http://demo.vaadin.com/book-examples-vaadin7/book/#component.field.buffering.basic
The discard button is broken. It commits too

The example is missing “setBuffered(true)”, so the input is first written directly to the data source, after which the edit is “discarded” by copying the data source to the editor…