Why does the binder need us to give him back the bean when using writeBean

Hi,

I am trying to perform a migration from vaadin 7 project to vaadin 8.

And I have little problem undestanding why in the binder the method writeBean (and writeBeanIfValid) needs us to give him the bean when the bean is already in the binder (when we used setBean method) ?

Thanks.
Best regards.

Using setBean() will make binder to automatically write any valid field value changes to the bean. It works similarly to the old Vaadin 7 unbuffered mode. When using setBean() you don’t need to call writeBean().

writeBean() is meant to be user with readBean() which works similarly to the buffered mode worked in Vaadin 7. There the values are only read from the bean, and binder does not keep a refenrence to the bean inside it.

See the
Automatic Saving
section in the binder documentation for more details.

Thanks for your clear reply.