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.
how to ignore some member fields when using fieldGroup.bindMemberFields
Hi,
I looked everywhere to see if I could find answer, please forgive me if this is duplicate.
I have a formlayout whose member fields are annotated with @PropertyId. I also have form fields which are not binded by item.
Example:
PropertysetItem personItem= new PropertysetItem();
item.addItemProperty("first_name", new ObjectProperty<String>("Zaphod"));
item.addItemProperty("last_name", new ObjectProperty<String>("parrea"));
class PersonForm extends FormLayout{
@PropertyId("firstName")
TextField firstname = new TextField("First Name");
@PropertyId("lastName")
TextField lastname = new TextField("Last Name");
//Full name not binded to any property
TextField fullname = new TextField("Full Name");
addComponents(fullname, firstname, lastname)
}
//Please not no full name in person item but included in form just for display purpose
FieldGroup binder= new FieldGroup(personItem)
PersonForm form = new PersonForm()
//I get exception when I try to bind item because full name is not item property
//is there a way or annotation like @ignore so I can ignore fullname to be binded
binder.bindMemberFields(form)
//Only alternative I found is to bind each field in form by binder.bind(form.firstName, "first_name")
but it would be nice to if I can bind in one single line like binder.bindMemberFields(form)
//
}
Does this happen only with IndexedContainer?
Seems to me that FieldGroup uses Item.getItemProperty which is defined as "If the Item does not contain the Property, <code>null</code> is returned." but IndexedContainer implements getItemProperty so that it never returns null.