# HG changeset patch # User Bjoern Ricks # Date 1346419766 0 # Node ID 8c9c202292fe06a77de0d04467a965f1004928a0 # Parent 72d2ec6a471efbc5d5a3a9f0544b5819c0acaa24 Set the default value of the RadioGroupItem if a loaded module is selected flys-client/trunk@5333 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 72d2ec6a471e -r 8c9c202292fe flys-client/ChangeLog --- a/flys-client/ChangeLog Fri Aug 31 13:24:50 2012 +0000 +++ b/flys-client/ChangeLog Fri Aug 31 13:29:26 2012 +0000 @@ -1,3 +1,8 @@ +2012-08-31 Björn Ricks + + * src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java: + Set the default value of the RadioGroupItem if a module is selected. + 2012-08-31 Björn Ricks * src/main/java/de/intevation/flys/client/server/ModuleServiceImpl.java, diff -r 72d2ec6a471e -r 8c9c202292fe flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java Fri Aug 31 13:24:50 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java Fri Aug 31 13:29:26 2012 +0000 @@ -39,26 +39,6 @@ /** The message class that provides i18n strings.*/ protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); - - /** Constant field name for the plugin selection.*/ - public static final String FIELD_PLUGIN = "plugin"; - - /** Constant value for the WINFO plugin.*/ - public static final String FIELD_PLUGIN_WINFO = "winfo"; - - /** Constant value for the MINFO plugin.*/ - public static final String FIELD_PLUGIN_MINFO = "minfo"; - - /** Constant value for the MAP plugin.*/ - public static final String FIELD_PLUGIN_MAP = "new_map"; - - /** Constant value for the CHART plugin.*/ - public static final String FIELD_PLUGIN_CHART = "new_chart"; - - /** Constant value for the FIX plugin.*/ - public static final String FIELD_PLUGIN_FIX = "fixanalysis"; - - /** The module checkboxes.*/ protected RadioGroupItem radio; @@ -121,9 +101,17 @@ private void setModules() { LinkedHashMap values = new LinkedHashMap(); + if (this.modules!= null) { for(Module module : this.modules) { values.put(module.getName(), module.getLocalizedName()); + if (module.isSelected()) { + GWT.log("Module " + module.getName() + " is selected."); + if (radio != null) { + radio.setDefaultValue(module.getName()); + GWT.log("Setting " + module.getName() + " as selected."); + } + } } } if (radio != null) { @@ -153,11 +141,7 @@ setModules(); - /* LinkedHashMap initial = new LinkedHashMap(); */ - /* initial.put(FIELD_PLUGIN, FIELD_PLUGIN_WINFO); */ - form.setFields(radio); - /* form.setValues(initial); */ layout.addMember(label); layout.addMember(form);