changeset 1512:685bce693617

Issue451. Avoid loading more than one map output tab. flys-client/trunk@3657 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 12 Jan 2012 09:19:49 +0000
parents 9119bf1f9e5e
children f43862cc1e6e
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java
diffstat 2 files changed, 23 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed Jan 11 14:31:21 2012 +0000
+++ b/flys-client/ChangeLog	Thu Jan 12 09:19:49 2012 +0000
@@ -1,3 +1,11 @@
+2012-01-12  Raimund Renkert <raimund.renkert@intevation.de>
+
+	Issue451.
+
+	* src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
+	  Added recommendations queue. The queue avoids loading more than one
+	  map output tab.
+
 2012-01-11  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	Partial flys/issue439 (Streckenfavoriten lassen sich nicht über den
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Wed Jan 11 14:31:21 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Thu Jan 12 09:19:49 2012 +0000
@@ -109,6 +109,7 @@
     protected Layout layout;
 
     protected int artifactsQueue;
+    protected int recommendationQueue;
     protected Stack<Recommendation> newRecommendations;
 
 
@@ -132,6 +133,7 @@
         this.parameterList = new ParameterList(
             flys, this, messages.new_project());
         this.artifactsQueue     = 0;
+        this.recommendationQueue = 0;
         this.newRecommendations = new Stack<Recommendation>();
 
         addCollectionChangeHandler(this);
@@ -381,7 +383,14 @@
 
                     public void onSuccess(Collection newCollection) {
                         GWT.log("Successfully DESCRIBED collection.");
-                        setCollection(newCollection);
+                        boolean loaded = false;
+                        List<Recommendation> r = newCollection.getRecommendations();
+                        for (Recommendation rec: r) {
+                            loaded = newCollection.loadedRecommendation(rec);
+                        }
+                        if (loaded) {
+                           setCollection(newCollection);
+                        }
                     }
                 }
             );
@@ -588,6 +597,7 @@
 
                     artifactsQueue--;
                     addRecommendationsToCollection();
+                    recommendationQueue++;
                 }
             }
         );
@@ -614,7 +624,10 @@
                 public void onSuccess(Collection newCol) {
                     GWT.log("Successfully saved recommendations.");
                     newRecommendations.removeAllElements();
-                    setCollection(newCol);
+                    recommendationQueue--;
+                    if(recommendationQueue == 0) {
+                        setCollection(newCol);
+                    }
                 }
             }
         );

http://dive4elements.wald.intevation.org