BooleanFilter.java revision 1c8c2215e525de8813c375e796354f8ffb811a08
1package afeclient.client.table;
2
3import com.google.gwt.json.client.JSONBoolean;
4import com.google.gwt.json.client.JSONObject;
5
6public class BooleanFilter extends ListFilter {
7    public static final String[] choices = {"Yes", "No"};
8
9    public BooleanFilter(String fieldName) {
10        super(fieldName);
11        setChoices(choices);
12    }
13
14    public void addParams(JSONObject params) {
15        String selected = getMatchValue();
16        params.put(fieldName, JSONBoolean.getInstance(selected.equals("Yes")));
17    }
18}
19