Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
BeanFieldGroup how to clear data after persisting data?
How do I clear the beanfieldgroup fields?
I used
@PropertyId("firstName")
private TextField firstName;
@PropertyId("middleName")
private TextField middleName;
@PropertyId("lastName")
private TextField lastName;
@PropertyId("gender")
private OptionGroup gender;
@PropertyId("birthdate")
private DateField birthdate;
@PropertyId("age")
private TextField age;
private TextField username;
@PropertyId("email")
private TextField email;
@PropertyId("contact")
private TextField contact;
@PropertyId("address")
private TextArea address;
to bind my field
I try to
beanFieldGroup.setItemDataSource(new Information());
to clear data.. although it worked but it doesnt bind again.
what do I do to make this thing work again?
If you just want to clear the existing fields you can use setItemDataSource(null) as well.
What do you mean by "doesn't bind again"?
BTW. Couple of comments:
* your PropertyId annotations are obsolete as you seem to follow the naming convention
* I usually don't need BeanFieldGroup instance at all. I just use BeanFieldGroup.bindFieldsUnbuffered(bean,form) when new bean is assigned for editing. And practically I'll always use that method through Viritin add-ons AbstractForm.
cheers,
matti