diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/resource/SchemaStep.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/resource/SchemaStep.java index 916cbc7bfc6..9257976db31 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/resource/SchemaStep.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/resource/SchemaStep.java @@ -148,12 +148,16 @@ private ITab createSchemaEditor() { @Override public WebMarkupContainer getPanel(String panelId) { - XmlEditorPanel xmlEditorPanel = new XmlEditorPanel(panelId, createXmlEditorModel()); - // quick fix: now changes from XmlEditorPanel are not saved anyhow - //(e.g. by clicking Finish button in wizard). For now, - //panel is made disabled for editing - AceEditor aceEditor = (AceEditor) xmlEditorPanel.get(ID_ACE_EDITOR); - aceEditor.setReadonly(true); + XmlEditorPanel xmlEditorPanel = new XmlEditorPanel(panelId, createXmlEditorModel()) { + + // quick fix: now changes from XmlEditorPanel are not saved anyhow + //(e.g. by clicking Finish button in wizard). For now, + @Override + protected boolean isEditEnabled() { + return false; + } + }; + return xmlEditorPanel; } }; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/resource/component/XmlEditorPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/resource/component/XmlEditorPanel.java index 0f270820c4d..10fb7fa7c5f 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/resource/component/XmlEditorPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/resource/component/XmlEditorPanel.java @@ -7,6 +7,7 @@ package com.evolveum.midpoint.web.component.wizard.resource.component; +import com.evolveum.midpoint.web.component.util.EnableBehaviour; import org.apache.wicket.model.IModel; import com.evolveum.midpoint.gui.api.component.BasePanel; @@ -32,6 +33,11 @@ protected void onInitialize() { protected void initLayout() { AceEditor editor = new AceEditor(ID_ACE_EDITOR, getModel()); + editor.setReadonly(!isEditEnabled()); add(editor); } + + protected boolean isEditEnabled() { + return true; + } }