Hi,
I want to build a form dynamically, knowing the bean and the fields at runtime. The superclass of the bean is GenericModel, but the bean is one of its derived classes.
In the array propertyNames I have the names of all properties of the bean
public void cretaBinder(GenericModel genericModel) {
Binder binder=new Binder<>(genericModel.getClass());
for (myProperty : propertyNames){
TextField textField=new textField();
binder.bind(textField,getter,setter);
}
}
How can I replace getter and setter, knowing the name of the property? I can get the getter and setter method by reflection, but bind wants a functional Interface ValueProvider.
How can I get getter and setter ValueProvider to be passed to bind?
Thank you