19 package org.turro.contacts.duplicates;
21 import java.util.function.Consumer;
22 import org.turro.contacts.Contact;
23 import org.turro.elephant.util.Components;
24 import org.zkoss.bind.annotation.BindingParam;
25 import org.zkoss.bind.annotation.Command;
26 import org.zkoss.bind.annotation.ExecutionArgParam;
27 import org.zkoss.bind.annotation.Init;
28 import org.zkoss.zk.ui.Component;
29 import org.zkoss.zk.ui.event.Event;
30 import org.zkoss.zk.ui.event.Events;
31 import org.zkoss.zul.Window;
41 private Consumer<Contact> onSave;
44 public void init(@ExecutionArgParam(
"contact")
Contact contact,
46 @ExecutionArgParam(
"onSave") Consumer<Contact> onSave) {
47 this.contact = contact;
48 this.dupmodel = dupmodel;
53 public void onSave(@BindingParam(
"component") Component component) {
54 onSave.accept(contact);
55 Events.postEvent(
new Event(Events.ON_CLOSE,
Components.
from(component).parent(Window.class),
null));
59 public void onCancel(@BindingParam(
"component") Component component) {
60 Events.postEvent(
new Event(Events.ON_CLOSE,
Components.
from(component).parent(Window.class),
null));
static Components from(Object component)