changeset 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 1f63e2ef03d2
children d92770527b0f
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java
diffstat 2 files changed, 16 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Jun 21 11:32:22 2012 +0000
+++ b/flys-client/ChangeLog	Thu Jun 21 11:55:37 2012 +0000
@@ -1,3 +1,11 @@
+2012-06-21	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java:
+	  Create 
+	    "columns": { "cids": "1 2 3" }
+	  instead of 
+	    "or": ["column": { "cid": 1 }, "column": { "cid": 2 }, "column": { "cid": 3 }]
+
 2012-06-21	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/server/FixingsOverviewServiceImpl.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java	Thu Jun 21 11:32:22 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java	Thu Jun 21 11:55:37 2012 +0000
@@ -8,7 +8,6 @@
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 
-import com.google.gwt.json.client.JSONArray;
 import com.google.gwt.json.client.JSONObject;
 import com.google.gwt.json.client.JSONNumber;
 import com.google.gwt.json.client.JSONString;
@@ -495,16 +494,15 @@
                 and.put("sector-range", classrange);
             }
             if (this.events.length > 0) {
-                JSONArray col = new JSONArray();
-                for(int i = 0; i < this.events.length; i++) {
-                    JSONObject column = new JSONObject();
-                    JSONObject cid = new JSONObject();
-                    JSONNumber id = new JSONNumber(this.events[i]);
-                    cid.put("cid", id);
-                    column.put("column", cid);
-                    col.set(i, column);
+                StringBuilder cids = new StringBuilder();
+
+                for (int i = 0; i < events.length; i++) {
+                    if (i > 0) cids.append(' ');
+                    cids.append(events[i]);
                 }
-                and.put("or", col);
+                JSONObject columns = new JSONObject();
+                columns.put("cids", new JSONString(cids.toString()));
+                and.put("columns", columns);
             }
             if (and.size() > 0) {
                 JSONObject filter = new JSONObject();

http://dive4elements.wald.intevation.org