diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java index a5b601e5dc..606656ea6c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java @@ -233,8 +233,16 @@ public class WStringEditor extends WEditor implements ContextMenuListener else if (WEditorPopupMenu.EDITOR_EVENT.equals(evt.getContextEvent())) { adwindowContent = findADWindowContent(); + boolean isHtml = false; + if (( gridField.getDisplayType() == DisplayType.Text + || gridField.getDisplayType() == DisplayType.TextLong + || gridField.getDisplayType() == DisplayType.Memo) + && adwindowContent != null + && adwindowContent.getActiveGridTab() != null) { + isHtml = adwindowContent.getActiveGridTab().getValueAsBoolean("IsHtml"); + } final WTextEditorDialog dialog = new WTextEditorDialog(gridField.getVO().Header, getDisplay(), - isReadWrite(), gridField.getFieldLength()); + isReadWrite(), gridField.getFieldLength(), isHtml); dialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override public void onEvent(Event event) throws Exception { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTextEditorDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTextEditorDialog.java index 589487da2f..3efe983d31 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTextEditorDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTextEditorDialog.java @@ -38,11 +38,11 @@ import org.zkoss.zul.Vlayout; * */ public class WTextEditorDialog extends Window implements EventListener{ - /** * */ - private static final long serialVersionUID = -3852236029054284848L; + private static final long serialVersionUID = 1188165765430615546L; + private boolean editable; private int maxSize; private String text; @@ -59,8 +59,9 @@ public class WTextEditorDialog extends Window implements EventListener{ * @param text * @param editable * @param maxSize + * @param isHtml - select the html tab at start */ - public WTextEditorDialog(String title, String text, boolean editable, int maxSize) { + public WTextEditorDialog(String title, String text, boolean editable, int maxSize, boolean IsHtml) { super(); setTitle(title); this.editable = editable; @@ -68,8 +69,14 @@ public class WTextEditorDialog extends Window implements EventListener{ this.text = text; init(); + if (IsHtml) + tabbox.setSelectedTab(htmlTab); } - + + public WTextEditorDialog(String title, String text, boolean editable, int maxSize) { + this(title, text, editable, maxSize, false); + } + private void init() { setBorder("normal"); setHeight("450px");