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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 month ago
Binder with nested field
Hello,
is there a simple way in Vaadin 8 to bind nested properties and take full advantage of JSR-303?
public class MyObject {
private String field;
private MyOtherObject other = new MyOtherObject();
...
}
public class MyOtherObject {
@Size(min = 1)
private String field;
...
}
Binder<MyObject> binder = new Binder<>(MyObject.class);
binder.bind(textField1, "field");
// java.lang.IllegalArgumentException: Could not resolve property name... :
binder.bind(textField2, "other.field");
I could do this but without automatic bean validation:
binder.bind(textField2, obj -> obj.getOther().getField(), (obj,value) -> obj.getOther().setField(value));
Thanks
Last updated on
You cannot reply to this thread.