From 06b2249b08fdc5e4a1eb1d2a9b5a84b44fd4a4b4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 26 Nov 2012 15:20:23 -0500 Subject: [PATCH] Stop NPE messages on performance indicators --- .../org/adempiere/webui/dashboard/DPPerformance.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPPerformance.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPPerformance.java index 7ebd941d39..c5d9c38042 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPPerformance.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPPerformance.java @@ -17,6 +17,7 @@ import org.adempiere.webui.apps.graph.WPAPanel; import org.adempiere.webui.util.ServerPushTemplate; import org.zkoss.zk.au.out.AuScript; import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.Page; import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.util.Clients; @@ -46,14 +47,16 @@ public class DPPerformance extends DashboardPanel { public void refresh(ServerPushTemplate template) { super.refresh(template); - Events.echoEvent("onPostRender", this, null); + if (Executions.getCurrent() != null) + Events.echoEvent("onPostRender", this, null); } @Override public void onPageAttached(Page newpage, Page oldpage) { super.onPageAttached(newpage, oldpage); if (newpage != null) { - Events.echoEvent("onPostRender", this, null); + if (Executions.getCurrent() != null) + Events.echoEvent("onPostRender", this, null); } } @@ -63,6 +66,7 @@ public class DPPerformance extends DashboardPanel { Component grid = this.getFirstChild().getFirstChild(); String script = "setTimeout(function() { var grid = jq('#" + grid.getUuid() + "');"; script = script + "grid.parent().height(grid.css('height'));}, 500);"; - Clients.response(new AuScript(script)); + if (Executions.getCurrent() != null) + Clients.response(new AuScript(script)); } }