BrightSide Workbench Full Report + Source Code
VendorFilterGrid.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2012 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.crm.zul.vendor;
20 
21 import org.turro.contacts.filter.CityFilterField;
22 import org.turro.contacts.filter.GlobalIdentifierFilterField;
23 import org.turro.contacts.filter.ProvinceFilterField;
24 import org.turro.contacts.filter.ZipCodeFilterField;
25 import org.turro.elephant.db.WhereClause;
26 import org.turro.zkoss.filter.FilterField;
27 import org.turro.zkoss.filter.FilterGrid;
28 
33 public class VendorFilterGrid extends FilterGrid {
34 
35  public VendorFilterGrid() {
36  super();
37  addField(new FilterField("Name", "") {
38  @Override
39  public void addConstraint(WhereClause wc) {
40  doAddConstraint(wc, "ven.name");
41  }
42  });
44  @Override
45  public String getContactField() {
46  return "ven.idContact";
47  }
48  });
50  @Override
51  public String getContactField() {
52  return "ven.idContact";
53  }
54  });
56  @Override
57  public String getContactField() {
58  return "ven.idContact";
59  }
60  });
62  @Override
63  public String getContactField() {
64  return "ven.idContact";
65  }
66  });
67  if(!loadPreferences(this.getClass().getName()+"_filter")) {
68  addCurrentField("Name");
69  }
70  }
71 
72 }
FilterField addField(FilterField filterField)
Definition: FilterGrid.java:62
boolean loadPreferences(String preference)
FilterField addCurrentField(String label)
Definition: FilterGrid.java:67