-
Notifications
You must be signed in to change notification settings - Fork 721
Closed
Labels
Milestone
Description
If you have two beans:
public class Bean {
private SubBean sub;
// + getter setter
}
public class SubBean {
private String name;
// + getter setter
You would expect to be able to do
Binder<Bean> binder = new Binder<>(Bean.class);
binder.bind(new TextField(), "sub.name");
but this results in
java.lang.IllegalArgumentException: Could not resolve property name sub.name from Property set for bean Bean
and you end up writing something like
binder.bind(new TextField(), bean -> {
if (bean.getSub() == null) {
return "";
} else {
return bean.getSub().getName();
}
}, (bean, value) -> {
if (bean.getSub() == null) {
bean.setSub(new SubBean());
}
bean.getSub().setName(value);
});
mstahv, Legioth, chrosim, f92dev, macjuan and 6 moremstahv