comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterMatrix.java @ 4627:d5821c6f0ab0

Fixed validation in parameter matrix panel. Single selections are allowed now. Avoid adding duplicates of user selection in parameter matrix.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 03 Dec 2012 17:25:49 +0100
parents 03de5c424f95
children
comparison
equal deleted inserted replaced
4626:5b551e3a58d5 4627:d5821c6f0ab0
261 if (listGrid == null) { 261 if (listGrid == null) {
262 return selected; 262 return selected;
263 } 263 }
264 264
265 ListGridRecord[] records = listGrid.getRecords(); 265 ListGridRecord[] records = listGrid.getRecords();
266 for (ListGridRecord record: records) { 266 Map<String, List<String>> result = new HashMap<String, List<String>>();
267 for (ListGridRecord record : records) {
267 for (int i = 0, n = columnNames.size(); i < n; i++) { 268 for (int i = 0, n = columnNames.size(); i < n; i++) {
268 String columnName = columnNames.get(i); 269 String columnName = columnNames.get(i);
269 List<String> chosenItems = selected.get(columnName);
270 if (Boolean.valueOf(record.getAttribute(columnName)) == true) { 270 if (Boolean.valueOf(record.getAttribute(columnName)) == true) {
271 chosenItems.add(record.getAttribute(columnName + "-value")); 271 if (result.containsKey(columnName)) {
272 } 272 result.get(columnName).add(record.getAttribute(columnName + "-value"));
273 } 273 }
274 } 274 else {
275 return selected; 275 List<String> items = new ArrayList<String>();
276 items.add(record.getAttribute(columnName + "-value"));
277 result.put(columnName, items);
278 }
279 }
280 }
281 }
282 return result;
276 } 283 }
277 } 284 }
278 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 285 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org