changeset 54:0db278371632

Remove the dynamic parameter panel if a state is reached that doesn't need any user input. flys-client/trunk@1510 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 18 Mar 2011 07:45:34 +0000
parents 3d5d7788d471
children 4439f642f632
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java
diffstat 3 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Mar 17 18:34:20 2011 +0000
+++ b/flys-client/ChangeLog	Fri Mar 18 07:45:34 2011 +0000
@@ -1,3 +1,11 @@
+2011-03-18  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/ParameterList.java,
+	  src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
+	  When a state is reached with no further user input, the 'current'
+	  property of the ParameterList is set to 'null' and no dynamic panel is
+	  shown.
+
 2011-03-17  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Thu Mar 17 18:34:20 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Fri Mar 18 07:45:34 2011 +0000
@@ -390,6 +390,7 @@
 
         DataList currentData = desc.getCurrentData();
         if (currentData != null) {
+            // the user has to enter some attributes
             String uiProvider   = currentData.getUIProvider();
             UIProvider provider = UIProviderFactory.getProvider(uiProvider);
 
@@ -398,6 +399,10 @@
 
             parameterList.setCurrentData(currentData, provider);
         }
+        else {
+            // we have reached a final state with no more user input
+            parameterList.setCurrentData(null, null);
+        }
 
         parameterList.addOldDatas(desc.getOldData());
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java	Thu Mar 17 18:34:20 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java	Fri Mar 18 07:45:34 2011 +0000
@@ -133,10 +133,13 @@
      */
     public void refreshCurrent() {
         currentItems.removeMembers(currentItems.getMembers());
-        Canvas c = uiProvider.create(current);
-        c.setLayoutAlign(VerticalAlignment.TOP);
 
-        currentItems.addMember(c);
+        if (current != null && uiProvider != null) {
+            Canvas c = uiProvider.create(current);
+            c.setLayoutAlign(VerticalAlignment.TOP);
+
+            currentItems.addMember(c);
+        }
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org