Permalink
Browse files

KARAF-1793 Fix configuration edit form (file missed in previous commit).

Signed-off-by: Lukasz Dywicki <luke@code-house.org>

git-svn-id: https://svn.apache.org/repos/asf/karaf/webconsole/trunk@1381425 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 0cdd2de commit d7be29d3c41d8e52cb10d4d1462cc498b36ec7ac @splatch splatch committed Sep 5, 2012
@@ -53,20 +53,20 @@ public ConfigurationEditPage(PageParameters params) {
pid = params.get("pid").toString();
add(new Label("pid", pid));
- Configuration configuration = new ConfigurationModel(pid, configurationAdmin).getObject();
+ ConfigurationModel configuration = new ConfigurationModel(pid, configurationAdmin);
+ setDefaultModel(configuration);
@SuppressWarnings("unchecked")
- Map<String, String> properties = DictionaryUtils.map(configuration.getProperties());
+ Map<String, String> properties = DictionaryUtils.map(configuration.getObject().getProperties());
Map<String, String> system = ConfigurationFilterUtil.filter(properties);
- CompoundPropertyModel<Map<String, String>> formModel = new CompoundPropertyModel<Map<String, String>>(properties);
- MapEditForm<String, String> mapEditForm = new MapEditForm<String, String>("edit", formModel) {
+ MapEditForm<String, String> mapEditForm = new MapEditForm<String, String>("edit", new CompoundPropertyModel<Map<String, String>>(properties)) {
@Override
protected void onSubmit() {
Map<String, String> map = getModelObject();
+ Configuration configuration = (Configuration) ConfigurationEditPage.this.getDefaultModelObject();
try {
- Configuration configuration = new ConfigurationModel(pid, configurationAdmin).getObject();
if (configuration.getBundleLocation() != null) {
configuration.setBundleLocation(null);
}
@@ -75,7 +75,7 @@ protected void onSubmit() {
Session.get().info("Configuration " + pid + " updated.");
RequestCycle.get().setResponsePage(ConfigurationsPage.class);
} catch (IOException e) {
- e.printStackTrace();
+ error("Unable to update configuration " + e.getMessage());
}
}
};

0 comments on commit d7be29d

Please sign in to comment.