# HG changeset patch # User Raimund Renkert # Date 1340284931 0 # Node ID d92770527b0f352e71ed71aae0093e2a4c097722 # Parent be99bf1aa59bd28ada654919090b712c811b6aad Changed handler for km navigation in fix analysis charts. flys-client/trunk@4743 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r be99bf1aa59b -r d92770527b0f flys-client/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java: diff -r be99bf1aa59b -r d92770527b0f flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.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();