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?
@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
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.
Thank you sir.. :)
It gives me an idea..