From 3cf71dc419cd5b825b3dd9254f7bf90406000c7a Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 11 Jul 2008 23:53:01 +0000 Subject: [PATCH] * fixed javascript error with menu search panel * fixed account viewer dialog * more complete statusbar implementation --- .../org/adempiere/webui/acct/WAcctViewer.java | 49 +++++++++++------- .../webui/panel/AbstractADWindowPanel.java | 2 +- .../org/adempiere/webui/panel/MenuPanel.java | 5 ++ .../webui/panel/MenuSearchPanel.java | 11 +++- .../adempiere/webui/panel/StatusBarPanel.java | 50 +++++++++++++++---- .../webui/window/WAccountDialog.java | 22 ++++---- 6 files changed, 97 insertions(+), 42 deletions(-) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java b/zkwebui/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java index d12cf1a36c..6c4d5a7477 100755 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java @@ -23,7 +23,6 @@ import java.util.Iterator; import java.util.logging.Level; import org.adempiere.webui.apps.AEnv; -import org.adempiere.webui.apps.ProcessModalDialog; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Checkbox; import org.adempiere.webui.component.Datebox; @@ -54,8 +53,10 @@ import org.compiere.util.ValueNamePair; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; +import org.zkoss.zkex.zul.Borderlayout; +import org.zkoss.zkex.zul.Center; +import org.zkoss.zkex.zul.South; import org.zkoss.zul.Caption; -import org.zkoss.zul.Div; import org.zkoss.zul.Groupbox; import org.zkoss.zul.Hbox; import org.zkoss.zul.Listcell; @@ -181,7 +182,7 @@ public class WAcctViewer extends Window implements EventListener try { - jbInit(); + init(); dynInit (AD_Table_ID, Record_ID); AEnv.showWindow(this); } @@ -204,7 +205,7 @@ public class WAcctViewer extends Window implements EventListener * @throws Exception */ - private void jbInit() throws Exception + private void init() throws Exception { // Selection Panel @@ -486,17 +487,14 @@ public class WAcctViewer extends Window implements EventListener // Result Tab - Div div = new Div(); - div.setStyle("overflow:auto"); - div.setWidth("100%"); - div.appendChild(table); - - table.setWidth("1200px"); - table.setMold("paging"); - table.setPageSize(10); + table.setWidth("99%;"); +// table.setMold("paging"); +// table.setPageSize(10); + table.setVflex(true); result.setWidth("100%"); - result.appendChild(div); + result.setHeight("100%"); + result.appendChild(table); // Query Tab @@ -519,13 +517,27 @@ public class WAcctViewer extends Window implements EventListener tabpanels.appendChild(result); tabbedPane.setWidth("100%"); + tabbedPane.setHeight("100%"); tabbedPane.appendChild(tabs); tabbedPane.appendChild(tabpanels); - VerticalBox mainBox = new VerticalBox(); - mainBox.setWidth("100%"); - mainBox.appendChild(tabbedPane); - mainBox.appendChild(southPanel); + Borderlayout layout = new Borderlayout(); + layout.setParent(this); + layout.setHeight("100%"); + layout.setWidth("100%"); + layout.setStyle("background-color: transparent"); + + Center center = new Center(); + center.setParent(layout); + center.setFlex(true); + center.setStyle("background-color: transparent"); + tabbedPane.setParent(center); + + South south = new South(); + south.setParent(layout); + south.setFlex(true); + south.setStyle("background-color: transparent"); + southPanel.setParent(south); this.setAttribute("mode", "modal"); this.setTitle("Posting"); @@ -533,7 +545,7 @@ public class WAcctViewer extends Window implements EventListener this.setClosable(true); this.setWidth("800px"); this.setHeight("500px"); - this.appendChild(mainBox); + this.setSizable(true); //tabbedPane.addEventListener(Events.ON_SELECT, this); } @@ -897,6 +909,7 @@ public class WAcctViewer extends Window implements EventListener if (table.getListhead() == null) { Listhead listhead = new Listhead(); + listhead.setSizable(true); for (int i = 0; i < rmodel.getColumnCount(); i++) { diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java index fdf957a55d..3f97819bd3 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java @@ -699,7 +699,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To String trxInfo = curTab.getTrxInfo(); if (trxInfo != null) { -// statusBar.setInfo(trxInfo); + statusBar.setInfo(trxInfo); } // Check Attachment diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuPanel.java index da54e71951..44c5aaa20d 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuPanel.java @@ -237,4 +237,9 @@ public class MenuPanel extends Panel implements EventListener { return true; } + + public Tree getMenuTree() + { + return menuTree; + } } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuSearchPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuSearchPanel.java index 6ffa3c7a47..3365950bef 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuSearchPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuSearchPanel.java @@ -25,6 +25,7 @@ import org.adempiere.webui.component.Panel; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; +import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.Treeitem; /** @@ -110,10 +111,17 @@ public class MenuSearchPanel extends Panel implements EventListener if (treeItem != null) { select(treeItem); - Events.echoEvent(Events.ON_SELECT, treeItem.getTree(), null); + Clients.showBusy("Loding...", true); + Events.echoEvent("onPostSelect", this, null); } } } + + public void onPostSelect() { + Clients.showBusy(null, false); + Event event = new Event(Events.ON_SELECT, menuPanel.getMenuTree()); + Events.postEvent(event); + } private void select(Treeitem selectedItem) { Treeitem parent = selectedItem.getParentItem(); @@ -124,6 +132,5 @@ public class MenuSearchPanel extends Panel implements EventListener parent = parent.getParentItem(); } selectedItem.getTree().setSelectedItem(selectedItem); - selectedItem.focus(); } } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/StatusBarPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/StatusBarPanel.java index 02dfb54b9b..9b5d8228eb 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/StatusBarPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/StatusBarPanel.java @@ -17,11 +17,14 @@ package org.adempiere.webui.panel; +import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Panel; -import org.adempiere.webui.component.VerticalBox; import org.compiere.model.DataStatusEvent; +import org.zkoss.zul.Div; import org.zkoss.zul.Hbox; +import org.zkoss.zul.Separator; +import org.zkoss.zul.Vbox; /** * This class is based on org.compiere.apps.StatusBar written by Jorg Janke. @@ -37,6 +40,7 @@ public class StatusBarPanel extends Panel private Label statusDB; private Label statusLine; + private Label infoLine; public StatusBarPanel() { @@ -47,19 +51,38 @@ public class StatusBarPanel extends Panel private void init() { statusLine = new Label(); - //statusLine.setWidth("100%"); - statusDB = new Label(); - statusDB.setWidth("200px"); + infoLine = new Label(); Hbox hbox = new Hbox(); - hbox.appendChild(statusLine); - hbox.appendChild(statusDB); + hbox.setWidth("100%"); + hbox.setHeight("100%"); + hbox.setWidths("50%, 50%"); + Div div = new Div(); + div.setStyle("text-align: left; "); + div.appendChild(statusLine); + div.setWidth("100%"); + Vbox vbox = new Vbox(); + vbox.setPack("center"); + LayoutUtils.addSclass("status", vbox); + vbox.appendChild(div); + hbox.appendChild(vbox); - VerticalBox mainBox = new VerticalBox(); - mainBox.appendChild(hbox); + div = new Div(); + div.setWidth("100%"); + div.setStyle("text-align: right; "); + div.appendChild(infoLine); + div.appendChild(statusDB); + statusDB.setStyle(""); + LayoutUtils.addSclass("status-db", statusDB); + LayoutUtils.addSclass("status-info", infoLine); + vbox = new Vbox(); + vbox.setPack("center"); + LayoutUtils.addSclass("status", vbox); + vbox.appendChild(div); + hbox.appendChild(vbox); - this.appendChild(mainBox); + this.appendChild(hbox); } public void setStatusDB (String text) @@ -90,4 +113,13 @@ public class StatusBarPanel extends Panel { statusLine.setValue(text); } + + /** + * Set Info Line + * @param text text + */ + public void setInfo (String text) + { + infoLine.setValue(text); + } // setInfo } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java b/zkwebui/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java index efb986a839..972adbb7a0 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java @@ -49,21 +49,18 @@ import org.zkoss.zul.Caption; import org.zkoss.zul.Div; import org.zkoss.zul.Groupbox; import org.zkoss.zul.Hbox; -import org.zkoss.zul.Separator; import org.zkoss.zul.Vbox; /** * Dialog to enter Account Info * - * @author Jorg Janke - * @version $Id: VAccountDialog.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ + * @author Low Heng Sin */ public final class WAccountDialog extends Window implements EventListener, DataStatusListener, ValueChangeListener { /** * Constructor - * @param frame frame * @param title title * @param mAccount account info * @param C_AcctSchema_ID as @@ -93,7 +90,7 @@ public final class WAccountDialog extends Window AEnv.showCenterScreen(this); else dispose(); - } // VLocationDialog + } // WAccountDialog /** Window No */ private int m_WindowNo; @@ -152,13 +149,14 @@ public final class WAccountDialog extends Window /** * Static component init. *
-	 *  - panel
-	 *      - northPanel
-	 *          - parameterPanel
-	 *          - toolBar
-	 *      - gridController
-	 *      - confirmPanel
-	 *  - statusBar
+	 *  - north
+	 *    - parameterPanel
+	 *    - toolBar
+	 *  - center
+	 *    - adtabpanel
+	 *  - south
+	 *    - confirmPanel
+	 *    - statusBar
 	 *  
* @throws Exception */