changeset 2918:d92770527b0f

Changed handler for km navigation in fix analysis charts. flys-client/trunk@4743 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 21 Jun 2012 13:22:11 +0000
parents be99bf1aa59b
children 0173b4498054
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java
diffstat 2 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Jun 21 11:55:37 2012 +0000
+++ b/flys-client/ChangeLog	Thu Jun 21 13:22:11 2012 +0000
@@ -1,3 +1,9 @@
+2012-06-21  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java:
+	  Changed handler for km navigation input from changed to keypress listening
+	  to 'Enter'-key.
+
 2012-06-21	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java	Thu Jun 21 11:55:37 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java	Thu Jun 21 13:22:11 2012 +0000
@@ -14,8 +14,8 @@
 
 import com.smartgwt.client.widgets.form.fields.TextItem;
 
-import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
-import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
+import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent;
+import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler;
 
 import com.smartgwt.client.widgets.form.validator.IsFloatValidator;
 
@@ -116,14 +116,17 @@
             }
         });
 
-        currentkm.addChangedHandler(new ChangedHandler() {
-            public void onChanged(ChangedEvent ce) {
-                if(ce.getForm().validate() && ce.getItem().getValue() != null) {
+        currentkm.addKeyPressHandler(new KeyPressHandler() {
+            public void onKeyPress(KeyPressEvent kpe) {
+                if (!kpe.getKeyName().equals("Enter")) {
+                    return;
+                }
+                if(kpe.getForm().validate() && kpe.getItem().getValue() != null) {
                     try {
-                        String s = ce.getItem().getValue().toString();
+                        String s = kpe.getItem().getValue().toString();
                         Double d = new Double(s);
-                        if (d < collectionView.getMaxKm() &&
-                            d > collectionView.getMinKm()) {
+                        if (d <= collectionView.getMaxKm() &&
+                            d >= collectionView.getMinKm()) {
                             collectionView.setCurrentKm(d);
                             if (right != null) {
                                 updateChartPanel();

http://dive4elements.wald.intevation.org