# HG changeset patch # User Felix Wolfsteller # Date 1341733474 0 # Node ID 0de3665daf361e2ae0d9156d642b08001f4a911f # Parent a30d77d8638610a1d98352cee4083d0441e59c47 Fix issue706. flys-client/trunk@4892 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r a30d77d86386 -r 0de3665daf36 flys-client/ChangeLog --- a/flys-client/ChangeLog Sat Jul 07 09:37:23 2012 +0000 +++ b/flys-client/ChangeLog Sun Jul 08 07:44:34 2012 +0000 @@ -1,4 +1,11 @@ -2012-07-02 Sascha L. Teichmann +2012-07-08 Felix Wolfsteller + + Fix issue706. + + * src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java: + Allow only one value to be entered by clicking. + +2012-07-07 Sascha L. Teichmann * src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java, src/main/java/de/intevation/flys/client/client/ui/chart/ManualWSPEditor.java, diff -r a30d77d86386 -r 0de3665daf36 flys-client/src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java Sat Jul 07 09:37:23 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java Sun Jul 08 07:44:34 2012 +0000 @@ -3,10 +3,16 @@ import java.util.ArrayList; import java.util.List; +import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.NumberFormat; import de.intevation.flys.client.shared.model.Data; +import com.smartgwt.client.widgets.grid.events.RecordClickHandler; +import com.smartgwt.client.widgets.grid.events.RecordClickEvent; + +import com.smartgwt.client.data.Record; + /** * This UIProvider creates a widget to enter a single location (km). @@ -89,5 +95,26 @@ return data; } + + + /* This is a copy of super.super.onRecordClick. Straighten out + this weird family. */ + /** + * Callback when an item from the input helper was clicked. + * Set the respective km-value in the location value field. + * @param e event passed. + */ + public void onRecordClick (RecordClickEvent e) { + Record record = e.getRecord(); + double[] selected = new double[1]; + try { + selected[0] = + Double.parseDouble(record.getAttribute("from")); + } + catch(NumberFormatException nfe) { + // Is there anything else to do here? + } + setLocationValues(selected); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :