18 package org.turro.financials.product;
20 import java.util.Collection;
21 import org.turro.command.CommandUtil;
22 import org.turro.elephant.util.DecimalFormats;
23 import org.turro.financials.entity.Product;
24 import org.turro.i18n.I_;
25 import org.turro.zkoss.filter.FilterGrid;
26 import org.turro.zkoss.grid.PagingGrid;
27 import org.zkoss.zk.ui.ext.AfterCompose;
28 import org.zkoss.zul.*;
44 this.filterGrid = filterGrid;
59 private void addRows() {
65 Rows rows =
new Rows();
68 for(
final Product prod : list) {
71 rows.appendChild(row);
72 row.appendChild(
new Label(prod.getProductCodeStr()));
73 row.appendChild(CommandUtil.getAdapter(prod).setLabel(prod.getDescription(
true)));
74 row.appendChild(
new Label(DecimalFormats.format(prod.getTax())));
75 row.appendChild(
new Label(DecimalFormats.format(prod.getProductPrice())));
81 private void addColumns() {
82 Columns cols =
new Columns();
85 Column col =
new Column(I_.get(
"Identifier"),
null,
"180px");
86 cols.appendChild(col);
88 col =
new Column(I_.get(
"Description"));
89 cols.appendChild(col);
91 col =
new Column(I_.get(
"Tax"),
null,
"90px");
92 col.setAlign(
"right");
93 cols.appendChild(col);
95 col =
new Column(I_.get(
"Price"),
null,
"120px");
96 col.setAlign(
"right");
97 cols.appendChild(col);
Collection< Product > getProducts(List< IFilterValue > values)
void setFilterGrid(FilterGrid filterGrid)
ProductFilter getFilter()
List< IFilterValue > getValues()
Rows getRows(boolean create)
void setRowCount(int rows)