changeset 890:c87500c42c5d

Fix flys/issue309 (crosssection-km-spinner does not respond to return key). flys-client/trunk@2730 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 14 Sep 2011 09:16:53 +0000
parents 2c9c3448e499
children f6c14ffdfd07
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed Sep 14 09:10:58 2011 +0000
+++ b/flys-client/ChangeLog	Wed Sep 14 09:16:53 2011 +0000
@@ -1,4 +1,12 @@
-2011-09-13  Raimund Renkert <raimund.renkert@intevation.de>
+2011-09-14	Felix Wolfsteller	<felix.wolfsteller@intevation.de> 
+
+	Fix flys/issue309 (crosssection-spinner does not trigger action when
+	return pressed).
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java:
+	  Trigger ChangedEvent on each keypress when any value given.
+
+2011-09-14  Raimund Renkert <raimund.renkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/ProjectList.java:
 	  Fixed NPE problem on empty list.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java	Wed Sep 14 09:10:58 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java	Wed Sep 14 09:16:53 2011 +0000
@@ -78,6 +78,7 @@
                         spinnerItem.setMin(0);
                         spinnerItem.setMax(1000);
                         spinnerItem.setStep(5f);
+                        spinnerItem.setChangeOnKeypress(true);
 
                         Config config = Config.getInstance();
                         final String serverUrl = config.getServerUrl();
@@ -86,6 +87,9 @@
                         spinnerItem.addChangedHandler(new ChangedHandler() {
                                 @Override
                                 public void onChanged(ChangedEvent ce) {
+                                    if (ce.getValue() == null) {
+                                        return;
+                                    }
                                     DefaultDataItem kmItem = new DefaultDataItem("cross_section.km",
                                         "cross_section.km", ce.getValue().toString());
                                     DefaultData km = new DefaultData("cross_section.km",

http://dive4elements.wald.intevation.org