From 4ef6a5d1638922758bc5948d8b9a3f3f699b6ac9 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 6 Aug 2013 07:56:01 +0800 Subject: [PATCH] IDEMPIERE-1248 Performance Optimization: Eliminate the fire and processing of duplicate event. Fixed problem with window that have no records ( reported by Carlos ). --- .../src/org/adempiere/webui/adwindow/ADTabpanel.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index 29252dc8d7..11dae34209 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -667,10 +667,14 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer //0 and -1 is same if (col < 0) col = 0; + int currentRow = getGridTab().isSortTab() ? 0 : getGridTab().getCurrentRow(); Execution exec = Executions.getCurrent(); - if (exec.getAttribute(ON_DYNAMIC_DISPLAY_CALL_EVENT_ATTR+"_"+col) == null) + StringBuilder builder = new StringBuilder(ON_DYNAMIC_DISPLAY_CALL_EVENT_ATTR).append("_") + .append(col).append("_").append(currentRow); + String key = builder.toString(); + if (exec.getAttribute(key) == null) { - exec.setAttribute(ON_DYNAMIC_DISPLAY_CALL_EVENT_ATTR+"_"+col, Boolean.TRUE); + exec.setAttribute(key, Boolean.TRUE); Events.sendEvent(ON_DYNAMIC_DISPLAY_CALL_EVENT, this, col); } }