1 package org.turro.crm.zul.sale;
4 import org.turro.crm.entity.FormulaType;
5 import org.turro.crm.entity.SaleProspect;
6 import org.turro.crm.entity.VendorProspect;
7 import org.turro.crm.zul.vendor.FormulaListbox;
8 import org.turro.crm.zul.vendor.VendorCombobox;
9 import org.turro.elephant.util.Messages;
10 import org.turro.i18n.I_;
11 import org.zkoss.zk.ui.event.Event;
12 import org.zkoss.zk.ui.event.EventListener;
13 import org.zkoss.zk.ui.event.Events;
14 import org.zkoss.zul.*;
23 private boolean editable;
25 private Toolbar toolbar;
26 private Toolbarbutton addButton;
34 this.editable = editable;
35 if(saleProspect !=
null) {
42 this.saleProspect = saleProspect;
43 rows.getChildren().clear();
44 if(saleProspect !=
null) {
51 toolbar =
new Toolbar();
52 getParent().appendChild(toolbar);
59 final Row row =
new Row();
61 rows.appendChild(row);
63 Vbox vbox =
new Vbox();
64 row.appendChild(vbox);
67 Hbox hbox =
new Hbox();
68 vbox.appendChild(hbox);
72 vendor.addEventListener(Events.ON_CHANGE,
new EventListener() {
74 public void onEvent(Event event)
throws Exception {
76 vp.setProspectDate(
new Date());
79 hbox.appendChild(vendor);
81 final Image img =
new Image(
"/_zul/images/delete.png");
82 img.setStyle(
"cursor:pointer");
83 img.addEventListener(Events.ON_CLICK,
new EventListener() {
85 public void onEvent(Event event)
throws Exception {
92 hbox.appendChild(img);
97 comission.addEventListener(Events.ON_SELECT,
new EventListener() {
99 public void onEvent(Event event)
throws Exception {
103 vbox.appendChild(comission);
109 alert.addEventListener(Events.ON_SELECT,
new EventListener() {
111 public void onEvent(Event event)
throws Exception {
115 vbox.appendChild(alert);
119 Label label =
new Label(vp.getVendor() !=
null ? vp.getVendor().getName() :
"***");
120 vbox.appendChild(label);
122 label =
new Label(vp.getComission().getName());
123 vbox.appendChild(label);
125 label =
new Label(vp.getAlert().getName());
126 vbox.appendChild(label);
131 private void addToolbarButtons() {
132 addButton =
new Toolbarbutton(
134 "/_zul/images/new.png"
136 addButton.addEventListener(Events.ON_CLICK,
new EventListener() {
138 public void onEvent(Event event)
throws Exception {
145 toolbar.appendChild(addButton);
150 private void updateButtons() {
151 if(toolbar !=
null) {
152 addButton.setVisible(editable);
Set< VendorProspect > getVendorProspects()
void setSaleProspect(SaleProspect saleProspect)
void setAddToolbar(boolean addToolbar)
void setSaleProspect(SaleProspect saleProspect)
void setEditable(boolean editable)
static Messages confirmDeletion()
static String get(String msg)