18 package org.turro.financials.document;
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.DocumentDefinition;
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<DocumentDefinition> list =
new FinancialsPU().getResultList(
51 "select docdef from DocumentDefinition as docdef order by docdef.name"
53 Rows rows =
new Rows();
58 rows.appendChild(row);
59 row.appendChild(
new Label(dd.getId() +
""));
60 Label l =
new Label(dd.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(dd.isAutoNumbered())));
75 private void addColumns() {
76 Columns cols =
new Columns();
79 Column col =
new Column(
"#",
null,
"25px");
80 cols.appendChild(col);
82 col =
new Column(I_.get(
"Name"));
83 cols.appendChild(col);
85 col =
new Column(I_.get(
"Autonumbered"),
null,
"100px");
86 cols.appendChild(col);
void setRowCount(int rows)