From 9551cae4fcba833a10c80584ca7667304073fc30 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 9 Jul 2008 23:18:04 +0000 Subject: [PATCH] * Remove hardcoded width for info listbox * don't stretch numberbox and datebox * make stretch work for urlbox and searchbox * enable showacct, showtrl and showadvance by default. revisit later when doing preference * fixed issue with page reload --- .../src/org/adempiere/webui/AdempiereWebUI.java | 7 ++++++- .../org/adempiere/webui/component/NumberBox.java | 3 ++- .../org/adempiere/webui/component/Searchbox.java | 5 ++++- .../src/org/adempiere/webui/component/Urlbox.java | 5 ++++- .../src/org/adempiere/webui/panel/ADTabpanel.java | 6 +++++- .../adempiere/webui/panel/InfoBPartnerPanel.java | 2 +- .../adempiere/webui/panel/InfoGeneralPanel.java | 10 ++++------ .../adempiere/webui/panel/InfoInvoicePanel.java | 15 +++++++-------- .../org/adempiere/webui/panel/InfoOrderPanel.java | 5 +++-- .../src/org/adempiere/webui/panel/InfoPanel.java | 2 ++ .../adempiere/webui/panel/InfoProductPanel.java | 5 +++-- .../org/adempiere/webui/session/WebContext.java | 2 +- 12 files changed, 42 insertions(+), 25 deletions(-) diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index 153ecc2048..2ef1f1b2eb 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -122,6 +122,11 @@ public class AdempiereWebUI extends Window implements EventListener, IWebClient MSession.get (ctx, currSess.getRemoteAddr(), currSess.getRemoteHost(), httpSess.getId() ); + //enable full interface, relook into this when doing preference + Env.setContext(ctx, "#ShowTrl", true); + Env.setContext(ctx, "#ShowAcct", true); + Env.setContext(ctx, "#ShowAdvanced", true); + IDesktop d = (IDesktop) currSess.getAttribute("application.desktop"); if (d != null && d instanceof Desktop) { @@ -142,7 +147,7 @@ public class AdempiereWebUI extends Window implements EventListener, IWebClient current.carryOver(); - appDesktop.getComponent().setPage(this.getPage()); + appDesktop.setPage(this.getPage()); currSess.setAttribute("execution.carryover", current); diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/NumberBox.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/NumberBox.java index 9e5e39b739..8d8b5b6c1f 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/NumberBox.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/NumberBox.java @@ -108,12 +108,13 @@ public class NumberBox extends Bandbox super.setValue(formattedValue); } + /* public void setReadonly(boolean readonly) { // Due to bug in bandbox - once set readonly, setting to not readonly // does not work super.setDisabled(readonly); - } + }*/ private Bandpopup getBandPopup() { diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/Searchbox.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/Searchbox.java index 3c6f6c023e..c4b97083a7 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/Searchbox.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/Searchbox.java @@ -21,8 +21,9 @@ import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Hbox; -public class Searchbox extends Panel +public class Searchbox extends Hbox { private static final long serialVersionUID = 1L; private PropertyChangeSupport m_propertyChangeListeners = new PropertyChangeSupport(this); @@ -48,7 +49,9 @@ public class Searchbox extends Panel private void initComponents() { txt = new Textbox(); + txt.setWidth("100%"); btn = new Button(); + btn.setHeight("98%"); appendChild(txt); appendChild(btn); } diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/Urlbox.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/Urlbox.java index be575fded3..73c9f28909 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/Urlbox.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/component/Urlbox.java @@ -18,11 +18,12 @@ package org.adempiere.webui.component; import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Hbox; /** * URL Box */ -public class Urlbox extends Panel +public class Urlbox extends Hbox { private static final long serialVersionUID = 1L; @@ -50,7 +51,9 @@ public class Urlbox extends Panel private void initComponents() { txtUrl = new Textbox(); + txtUrl.setWidth("100%"); btnUrl = new Button(); + btnUrl.setHeight("98%"); appendChild(txtUrl); appendChild(btnUrl); } diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java index 4d7c5d60e6..ed26f3178a 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java @@ -23,6 +23,8 @@ import java.util.List; import java.util.Map; import org.adempiere.webui.LayoutUtils; +import org.adempiere.webui.component.Bandbox; +import org.adempiere.webui.component.Datebox; import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.GridPanel; import org.adempiere.webui.component.Label; @@ -290,7 +292,9 @@ DataStatusListener, ValueChangeListener } if (comp.getComponent() instanceof HtmlBasedComponent) { - ((HtmlBasedComponent)comp.getComponent()).setWidth("100%"); + //can't stretch bandbox & datebox + if (!(comp.getComponent() instanceof Bandbox) && !(comp.getComponent() instanceof Datebox)) + ((HtmlBasedComponent)comp.getComponent()).setWidth("100%"); } WEditorPopupMenu popupMenu = comp.getPopupMenu(); diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java index c61387df8b..1a71ac5717 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java @@ -167,7 +167,7 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl checkVendor.addEventListener(Events.ON_CHECK, this); contentPanel = new WListbox(); - contentPanel.setWidth("100%"); + contentPanel.setWidth("99%"); contentPanel.setHeight("400px"); contentPanel.setStyle("overflow:auto"); diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java index 05fc200a00..b84c956484 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java @@ -37,7 +37,6 @@ import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.Msg; import org.zkoss.zk.ui.event.EventListener; -import org.zkoss.zul.Div; import org.zkoss.zul.Hbox; import org.zkoss.zul.Vbox; @@ -102,12 +101,11 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener Vbox mainPanel = new Vbox(); mainPanel.appendChild(parameterPanel); - Div div = new Div(); - div.setStyle("overflow:auto"); - div.setWidth("100%"); - div.appendChild(contentPanel); + contentPanel.setWidth("99%"); + contentPanel.setHeight("400px"); + contentPanel.setStyle("overflow:auto"); - mainPanel.appendChild(div); + mainPanel.appendChild(contentPanel); mainPanel.appendChild(confirmPanel); this.appendChild(mainPanel); diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java index e98c7c6f26..0437b54244 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java @@ -44,7 +44,6 @@ import org.compiere.util.KeyNamePair; import org.compiere.util.Msg; import org.compiere.util.Util; import org.zkoss.zk.ui.WrongValueException; -import org.zkoss.zul.Div; import org.zkoss.zul.Hbox; import org.zkoss.zul.Vbox; @@ -174,8 +173,9 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener editorOrder.addValueChangeListner(this); contentPanel = new WListbox(); - contentPanel.setWidth("1300px"); - contentPanel.setHeight("500px"); + contentPanel.setWidth("99%"); + contentPanel.setHeight("400px"); + contentPanel.setStyle("overflow:auto"); } private void init() @@ -268,11 +268,10 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener Vbox mainPanel = new Vbox(); mainPanel.setWidth("100%"); mainPanel.appendChild(parameterPanel); - Div div = new Div(); - div.setStyle("overflow:scroll"); - div.setWidth("100%"); - div.appendChild(contentPanel); - mainPanel.appendChild(div); + contentPanel.setWidth("99%"); + contentPanel.setHeight("400px"); + contentPanel.setStyle("overflow:auto"); + mainPanel.appendChild(contentPanel); mainPanel.appendChild(confirmPanel); mainPanel.appendChild(statusBar); diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java index 1421d16e98..e583de6931 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java @@ -151,8 +151,9 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener Env.getCtx(), "C_BPartner_ID"), "", true, false, true); editorBPartner.addValueChangeListner(this); contentPanel = new WListbox(); - contentPanel.setWidth("1000px"); - contentPanel.setHeight("500px"); + contentPanel.setWidth("99%"); + contentPanel.setHeight("400px"); + contentPanel.setStyle("overflow:auto"); } public void init() diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java index ad31c2924b..6aff5b090c 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java @@ -250,6 +250,8 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM confirmPanel = new ConfirmPanel(true,true,false,false,true,true); confirmPanel.addActionListener(Events.ON_CLICK, this); confirmPanel.setStyle("border-top: 2px groove #444; padding-top: 4px"); + + this.setSizable(true); } // init protected ConfirmPanel confirmPanel; /** Master (owning) Window */ diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java index 6898d47d0f..1862d92c53 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java @@ -202,8 +202,9 @@ public final class InfoProductPanel extends InfoPanel implements EventListener fieldVendor.setMaxlength(40); contentPanel = new WListbox(); - contentPanel.setWidth("1500px"); - contentPanel.setHeight("500px"); + contentPanel.setWidth("99%"); + contentPanel.setHeight("400px"); + contentPanel.setStyle("overflow:auto"); } // initComponents private void init() diff --git a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/session/WebContext.java b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/session/WebContext.java index 2ad626a2a9..ec58997f0c 100644 --- a/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/session/WebContext.java +++ b/extension/posterita/webui/WEB-INF/src/org/adempiere/webui/session/WebContext.java @@ -37,7 +37,7 @@ public final class WebContext extends Properties /** * Set english as default language */ - this.put(Env.LANGUAGE, Language.getBaseAD_Language()); + this.put(Env.LANGUAGE, Language.getBaseAD_Language()); } private static InheritableThreadLocal context = new InheritableThreadLocal() {