Search in sources :

Example 1 with ContactsTableComponent

use of org.linkki.samples.binding.components.ContactsTableComponent 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);
}
Also used : DefaultBindingManager(org.linkki.core.binding.DefaultBindingManager) BindingManager(org.linkki.core.binding.BindingManager) ContactsTableComponent(org.linkki.samples.binding.components.ContactsTableComponent) HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel) ArrayList(java.util.ArrayList) ContactComponent(org.linkki.samples.binding.components.ContactComponent) BindingContext(org.linkki.core.binding.BindingContext) DefaultBindingManager(org.linkki.core.binding.DefaultBindingManager) Contact(org.linkki.samples.binding.model.Contact)

Aggregations

HorizontalSplitPanel (com.vaadin.ui.HorizontalSplitPanel)1 ArrayList (java.util.ArrayList)1 BindingContext (org.linkki.core.binding.BindingContext)1 BindingManager (org.linkki.core.binding.BindingManager)1 DefaultBindingManager (org.linkki.core.binding.DefaultBindingManager)1 ContactComponent (org.linkki.samples.binding.components.ContactComponent)1 ContactsTableComponent (org.linkki.samples.binding.components.ContactsTableComponent)1 Contact (org.linkki.samples.binding.model.Contact)1