use of org.linkki.samples.binding.model.Contact in project linkki by linkki-framework.
the class ContactComponent method save.
private void save() {
Address address = addressPmo.getAddress();
Contact contact = contactPmo.getContact();
contact.setAddress(address);
persistAction.accept(contact);
reset();
}
use of org.linkki.samples.binding.model.Contact in project linkki by linkki-framework.
the class BindingSampleUI method init.
@Override
protected void init(VaadinRequest request) {
Page.getCurrent().setTitle("linkki Sample :: Bindings");
List<Contact> personStorage = new ArrayList<>();
BindingManager bindingManager = new DefaultBindingManager(ValidationService.NOP_VALIDATION_SERVICE);
BindingContext context = bindingManager.startNewContext("binding-sample");
ContactComponent contactComponent = new ContactComponent(p -> save(p, personStorage), context);
ContactsTableComponent contactsTable = new ContactsTableComponent(personStorage, contactComponent::editContact, context);
bindingManager.addUiUpdateObserver(contactsTable);
HorizontalSplitPanel panel = new HorizontalSplitPanel(contactComponent, contactsTable);
panel.setLocked(true);
setContent(panel);
}
Aggregations