19 package org.turro.contacts.zul.contact;
21 import org.turro.string.Strings;
22 import org.turro.auth.Authentication;
23 import org.turro.contacts.Connector;
24 import org.turro.contacts.Contact;
25 import org.turro.contacts.db.ContactsPU;
26 import org.turro.jpa.Dao;
27 import org.turro.plugin.contacts.IContact;
28 import org.zkoss.zk.ui.event.Event;
29 import org.zkoss.zk.ui.event.EventListener;
30 import org.zkoss.zk.ui.event.Events;
31 import org.zkoss.zul.Checkbox;
40 private String connector;
53 this.connector = connector;
54 if(contact !=
null && contact.
isValid() && !Strings.isBlank(connector)) {
55 setChecked(
"TRUE".equalsIgnoreCase(contact.
getConnector(connector)));
59 private void setConnectorValue(
boolean value) {
61 if(contact !=
null && contact.
isValid() && !Strings.isBlank(connector)) {
72 con.
setValue(value ?
"TRUE" :
"FALSE");
73 c = dao.saveObject(c);
78 private void addListener() {
79 addEventListener(Events.ON_CHECK,
new EventListener<Event>() {
81 public void onEvent(Event event) throws Exception {
82 setConnectorValue(isChecked());
static IContact getIContact()