Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java @ 602:3b670af34367
The adapted WQ panel now displays warnings if no information are present to validate user input.
flys-client/trunk@2208 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 22 Jun 2011 15:11:15 +0000 |
parents | a078ba1c139d |
children | 5bf652ba4581 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java Wed Jun 22 14:02:11 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java Wed Jun 22 15:11:15 2011 +0000 @@ -12,6 +12,7 @@ import com.smartgwt.client.types.TitleOrientation; import com.smartgwt.client.types.VerticalAlignment; +import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.form.DynamicForm; @@ -222,7 +223,17 @@ String key = iter.next(); DoubleArrayPanel dap = wqranges.get(key); - double[] mm = wranges.get(key); + + if (!dap.validateForm()) { + errors.add(MSG.error_invalid_double_value()); + return errors; + } + + double[] mm = wranges.get(key); + if (mm == null) { + SC.warn(MSG.error_read_minmax_values()); + continue; + } double[] values = dap.getInputValues(); double[] good = new double[values.length]; @@ -269,7 +280,17 @@ String key = iter.next(); DoubleArrayPanel dap = wqranges.get(key); - double[] mm = qranges.get(key); + + if (!dap.validateForm()) { + errors.add(MSG.error_invalid_double_value()); + return errors; + } + + double[] mm = qranges.get(key); + if (mm == null) { + SC.warn(MSG.error_read_minmax_values()); + continue; + } double[] values = dap.getInputValues(); double[] good = new double[values.length];