Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
601:3cf6ee30207c | 602:3b670af34367 |
---|---|
10 import com.google.gwt.core.client.GWT; | 10 import com.google.gwt.core.client.GWT; |
11 import com.google.gwt.i18n.client.NumberFormat; | 11 import com.google.gwt.i18n.client.NumberFormat; |
12 | 12 |
13 import com.smartgwt.client.types.TitleOrientation; | 13 import com.smartgwt.client.types.TitleOrientation; |
14 import com.smartgwt.client.types.VerticalAlignment; | 14 import com.smartgwt.client.types.VerticalAlignment; |
15 import com.smartgwt.client.util.SC; | |
15 import com.smartgwt.client.widgets.Canvas; | 16 import com.smartgwt.client.widgets.Canvas; |
16 import com.smartgwt.client.widgets.Label; | 17 import com.smartgwt.client.widgets.Label; |
17 import com.smartgwt.client.widgets.form.DynamicForm; | 18 import com.smartgwt.client.widgets.form.DynamicForm; |
18 import com.smartgwt.client.widgets.form.fields.RadioGroupItem; | 19 import com.smartgwt.client.widgets.form.fields.RadioGroupItem; |
19 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; | 20 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; |
220 while (iter.hasNext()) { | 221 while (iter.hasNext()) { |
221 List<String> tmpErrors = new ArrayList<String>(); | 222 List<String> tmpErrors = new ArrayList<String>(); |
222 | 223 |
223 String key = iter.next(); | 224 String key = iter.next(); |
224 DoubleArrayPanel dap = wqranges.get(key); | 225 DoubleArrayPanel dap = wqranges.get(key); |
225 double[] mm = wranges.get(key); | 226 |
227 if (!dap.validateForm()) { | |
228 errors.add(MSG.error_invalid_double_value()); | |
229 return errors; | |
230 } | |
231 | |
232 double[] mm = wranges.get(key); | |
233 if (mm == null) { | |
234 SC.warn(MSG.error_read_minmax_values()); | |
235 continue; | |
236 } | |
226 | 237 |
227 double[] values = dap.getInputValues(); | 238 double[] values = dap.getInputValues(); |
228 double[] good = new double[values.length]; | 239 double[] good = new double[values.length]; |
229 | 240 |
230 int idx = 0; | 241 int idx = 0; |
267 while (iter.hasNext()) { | 278 while (iter.hasNext()) { |
268 List<String> tmpErrors = new ArrayList<String>(); | 279 List<String> tmpErrors = new ArrayList<String>(); |
269 | 280 |
270 String key = iter.next(); | 281 String key = iter.next(); |
271 DoubleArrayPanel dap = wqranges.get(key); | 282 DoubleArrayPanel dap = wqranges.get(key); |
272 double[] mm = qranges.get(key); | 283 |
284 if (!dap.validateForm()) { | |
285 errors.add(MSG.error_invalid_double_value()); | |
286 return errors; | |
287 } | |
288 | |
289 double[] mm = qranges.get(key); | |
290 if (mm == null) { | |
291 SC.warn(MSG.error_read_minmax_values()); | |
292 continue; | |
293 } | |
273 | 294 |
274 double[] values = dap.getInputValues(); | 295 double[] values = dap.getInputValues(); |
275 double[] good = new double[values.length]; | 296 double[] good = new double[values.length]; |
276 | 297 |
277 int idx = 0; | 298 int idx = 0; |