comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java @ 2917:be99bf1aa59b

Create simplified column filter. flys-client/trunk@4739 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 21 Jun 2012 11:55:37 +0000
parents 7d69e570e79b
children 71db63f67d31
comparison
equal deleted inserted replaced
2916:1f63e2ef03d2 2917:be99bf1aa59b
6 import java.io.Serializable; 6 import java.io.Serializable;
7 7
8 import com.google.gwt.core.client.GWT; 8 import com.google.gwt.core.client.GWT;
9 import com.google.gwt.user.client.rpc.AsyncCallback; 9 import com.google.gwt.user.client.rpc.AsyncCallback;
10 10
11 import com.google.gwt.json.client.JSONArray;
12 import com.google.gwt.json.client.JSONObject; 11 import com.google.gwt.json.client.JSONObject;
13 import com.google.gwt.json.client.JSONNumber; 12 import com.google.gwt.json.client.JSONNumber;
14 import com.google.gwt.json.client.JSONString; 13 import com.google.gwt.json.client.JSONString;
15 import com.google.gwt.i18n.client.DateTimeFormat; 14 import com.google.gwt.i18n.client.DateTimeFormat;
16 15
493 classrange.put("from", f); 492 classrange.put("from", f);
494 classrange.put("to", t); 493 classrange.put("to", t);
495 and.put("sector-range", classrange); 494 and.put("sector-range", classrange);
496 } 495 }
497 if (this.events.length > 0) { 496 if (this.events.length > 0) {
498 JSONArray col = new JSONArray(); 497 StringBuilder cids = new StringBuilder();
499 for(int i = 0; i < this.events.length; i++) { 498
500 JSONObject column = new JSONObject(); 499 for (int i = 0; i < events.length; i++) {
501 JSONObject cid = new JSONObject(); 500 if (i > 0) cids.append(' ');
502 JSONNumber id = new JSONNumber(this.events[i]); 501 cids.append(events[i]);
503 cid.put("cid", id);
504 column.put("column", cid);
505 col.set(i, column);
506 } 502 }
507 and.put("or", col); 503 JSONObject columns = new JSONObject();
504 columns.put("cids", new JSONString(cids.toString()));
505 and.put("columns", columns);
508 } 506 }
509 if (and.size() > 0) { 507 if (and.size() > 0) {
510 JSONObject filter = new JSONObject(); 508 JSONObject filter = new JSONObject();
511 filter.put("and", and); 509 filter.put("and", and);
512 root.put("filter", filter); 510 root.put("filter", filter);

http://dive4elements.wald.intevation.org