19 package org.turro.zul.groupit;
21 import java.util.Collection;
22 import org.turro.contacts.Grouped;
23 import org.turro.entities.Entities;
24 import org.zkoss.zk.ui.event.Event;
25 import org.zkoss.zk.ui.event.EventListener;
26 import org.zkoss.zk.ui.event.Events;
27 import org.zkoss.zk.ui.ext.AfterCompose;
28 import org.zkoss.zul.Vlayout;
36 private String entityPath;
37 private boolean allowNew =
true, allowEdit =
true;
44 this.allowNew = allowNew;
52 this.allowEdit = allowEdit;
60 this.entityPath = entityPath;
70 addEventListener(Events.ON_CHANGE,
new EventListener<Event>() {
72 public void onEvent(Event event) throws Exception {
78 private void showGroups() {
79 getChildren().clear();
80 Collection<Grouped> groups = Grouped.groups(entityPath);
81 for(Grouped g : groups) {
82 GroupedLine gl =
new GroupedLine(g, allowEdit);
87 Grouped g =
new Grouped();
88 g.setPath(entityPath);
89 GroupedLine gl =
new GroupedLine(g,
true);
static IElephantEntity getController(String path)
void setEntity(Object entity)
void setEntityPath(String entityPath)
void setAllowNew(boolean allowNew)
void setAllowEdit(boolean allowEdit)