From c18698e47c501d68df5ef3ca0ea2274f9496f794 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Sat, 22 Nov 2008 18:04:16 +0000 Subject: [PATCH] * layout performance improvement * minor fix in WEditorPopupMenu --- .../adempiere/webui/component/GridPanel.java | 19 ++++++------------- .../webui/editor/WEditorPopupMenu.java | 3 ++- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java index 395d84fd04..446c02118e 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java @@ -72,17 +72,20 @@ public class GridPanel extends Borderlayout implements EventListener private Paging paging; private GridTabListItemRenderer renderer; + + private South south; public GridPanel() { - super(); - listbox = new Listbox(); + this(0); } public GridPanel(int windowNo) { this.windowNo = windowNo; listbox = new Listbox(); + south = new South(); + this.appendChild(south); } public void init(GridTab gridTab) @@ -225,22 +228,12 @@ public class GridPanel extends Borderlayout implements EventListener paging.setPageSize(pageSize); paging.setTotalSize(tableModel.getRowCount()); paging.setDetailed(true); - South south = new South(); south.appendChild(paging); - this.appendChild(south); paging.addEventListener(ZulEvents.ON_PAGING, this); - //workaround for layout problem - this.setVisible(false); - Clients.response(new AuEcho(this, "postRender", null)); + this.getParent().invalidate(); } } - public void postRender() - { - this.setVisible(true); - this.getParent().invalidate(); - } - private void updateModel() { listModel = new GridTableListModel((GridTable)tableModel, windowNo); listModel.setPageSize(pageSize); diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditorPopupMenu.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditorPopupMenu.java index dd37f18422..edb167be3c 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditorPopupMenu.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditorPopupMenu.java @@ -121,7 +121,8 @@ public class WEditorPopupMenu extends Menupopup implements EventListener public void addMenuListener(ContextMenuListener listener) { - menuListeners.add(listener); + if (!menuListeners.contains(listener)) + menuListeners.add(listener); } public void onEvent(Event event)