From fd6b6051ae835e582cf7abb79be63049b49bbe45 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 27 Jun 2013 00:05:26 +0800 Subject: [PATCH] IDEMPIERE-1012 Missing fields on detail when open for edition. Apply fix to url field. --- .../org/adempiere/webui/component/Urlbox.java | 30 ++++++++++++++----- .../adempiere/webui/editor/WUrlEditor.java | 5 ++++ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Urlbox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Urlbox.java index 50180e16ea..08de57d1e0 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Urlbox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Urlbox.java @@ -20,7 +20,6 @@ import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zul.A; import org.zkoss.zul.Div; -import org.zkoss.zul.Hlayout; /** * URL Box @@ -52,12 +51,10 @@ public class Urlbox extends Div } private void initComponents() { - Hlayout hlayout = new Hlayout(); - this.appendChild(hlayout); - hlayout.setHflex("1"); txt = new Textbox(); - hlayout.appendChild(txt); - txt.setHflex("1"); + appendChild(txt); + txt.setHflex("0"); + txt.setSclass("editor-input"); btn = new A(); btn.setTarget("_blank"); @@ -65,9 +62,10 @@ public class Urlbox extends Div btn.setSclass("editor-button"); btn.setZclass("z-button-os"); btn.setHflex("0"); - hlayout.appendChild(btn); + appendChild(btn); LayoutUtils.addSclass("editor-box", this); + setTableEditorMode(false); } /** @@ -112,6 +110,11 @@ public class Urlbox extends Div public void setEnabled(boolean enabled) { txt.setReadonly(!enabled); + if (enabled) { + LayoutUtils.removeSclass("editor-input-disd", txt); + } else { + LayoutUtils.addSclass("editor-input-disd", txt); + } } /** @@ -153,4 +156,17 @@ public class Urlbox extends Div public A getButton() { return btn; } + + public void setTableEditorMode(boolean flag) { + if (flag) { + setHflex("0"); + LayoutUtils.addSclass("grid-editor-input", txt); + LayoutUtils.addSclass("grid-editor-button", btn); + } else { + setHflex("1"); + LayoutUtils.removeSclass("grid-editor-input", txt); + LayoutUtils.removeSclass("grid-editor-button", btn); + } + + } } \ No newline at end of file diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java index 9f46e0ef1a..ba357c76c2 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java @@ -127,4 +127,9 @@ public class WUrlEditor extends WEditor implements ContextMenuListener } + @Override + public void setTableEditor(boolean b) { + super.setTableEditor(b); + getComponent().setTableEditorMode(b); + } }