18 package org.turro.zkoss.grid;
20 import java.util.Collection;
21 import org.zkoss.zk.ui.ext.AfterCompose;
22 import org.zkoss.zul.Row;
23 import org.zkoss.zul.Rows;
32 private Collection<V> collection;
41 this.collection = collection;
49 this.collection = collection;
69 if(collection !=
null) {
76 super.deleteSelectedRow(row);
77 processDependingRow();
82 super.cellChanged(editableCell, value);
86 V current = editableCell.
getRow().getValue();
87 for(V v : collection) {
88 if(value !=
null && v !=
null && !v.equals(current) && cmd.
check(value, v))
break;
102 processDependingRow();
109 private void addTableRows() {
111 appendChild(
new Rows());
113 boolean emptyLine =
false;
114 if(collection !=
null) {
115 for(V v : collection) {
120 emptyLine = emptyLine ? true : !
isValid(v);
127 row.setSclass(
"invalid");
132 private void processDependingRow() {
void setDependingRow(Row dependingRow)
CollectionGrid(Collection< V > collection)
void deleteSelectedRow(Row row)
void cellChanged(EditableCell editableCell, Object value)
void setCollection(Collection< V > collection)
Collection< V > getCollection()
void updateCollection(Collection< V > collection)
boolean isAllowInsertions()
abstract void initiateRow(Row row, V value)
abstract boolean isValid(V v)
Rows getRows(boolean create)
boolean check(Object newValue, Object rowValue)