18 package org.turro.financials.contract;
20 import java.util.List;
21 import org.turro.elephant.util.BooleanFormats;
22 import org.turro.financials.db.FinancialsPU;
23 import org.turro.financials.entity.ContractDefinition;
24 import org.turro.financials.menu.FinancialsMenu;
25 import org.turro.i18n.I_;
26 import org.turro.zkoss.grid.PagingGrid;
27 import org.zkoss.zk.ui.event.Event;
28 import org.zkoss.zk.ui.event.EventListener;
29 import org.zkoss.zk.ui.event.Events;
30 import org.zkoss.zk.ui.ext.AfterCompose;
31 import org.zkoss.zul.Column;
32 import org.zkoss.zul.Columns;
33 import org.zkoss.zul.Label;
34 import org.zkoss.zul.Row;
35 import org.zkoss.zul.Rows;
49 private void addRows() {
50 List<ContractDefinition> list =
new FinancialsPU().getResultList(
51 "select ctcdef from ContractDefinition as ctcdef order by ctcdef.name"
53 Rows rows =
new Rows();
58 rows.appendChild(row);
59 row.appendChild(
new Label(cd.getId() +
""));
60 Label l =
new Label(cd.getName());
61 l.setStyle(
"cursor:pointer");
62 l.addEventListener(Events.ON_CLICK,
new EventListener() {
64 public void onEvent(Event event)
throws Exception {
69 row.appendChild(
new Label(BooleanFormats.format(cd.isStock())));
70 row.appendChild(
new Label(BooleanFormats.format(cd.isCash())));
76 private void addColumns() {
77 Columns cols =
new Columns();
80 Column col =
new Column(
"#",
null,
"80px");
81 cols.appendChild(col);
83 col =
new Column(I_.get(
"Name"));
84 cols.appendChild(col);
86 col =
new Column(I_.get(
"Store"),
null,
"100px");
87 cols.appendChild(col);
89 col =
new Column(I_.get(
"Cash"),
null,
"100px");
90 cols.appendChild(col);
void setRowCount(int rows)