Mercurial > dive4elements > river
changeset 3530:8c9c202292fe
Set the default value of the RadioGroupItem if a loaded module is selected
flys-client/trunk@5333 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Bjoern Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 31 Aug 2012 13:29:26 +0000 (2012-08-31) |
parents | 72d2ec6a471e |
children | 718e5c6c992e |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java |
diffstat | 2 files changed, 13 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- 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 <bjoern.ricks@intevation.de> + + * 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 <bjoern.ricks@intevation.de> * src/main/java/de/intevation/flys/client/server/ModuleServiceImpl.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);