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(“Zaphod”));
item.addItemProperty(“last_name”, new ObjectProperty(“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)
//
}