IDEMPIERE-2029 Performance gadgets portlet is not sized correctly on login

This commit is contained in:
Elaine Tan 2014-07-15 14:27:38 -05:00
parent 36a7c16fa3
commit 1be17505b8
4 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,10 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Jul 1, 2014 2:53:42 PM SGT
-- IDEMPIERE-2029 Performance gadgets portlet is not sized correctly on login
INSERT INTO AD_SysConfig (AD_SysConfig_ID,ConfigurationLevel,Value,AD_SysConfig_UU,Updated,Created,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name,AD_Client_ID,EntityType) VALUES (200057,'C','500','70b3fe79-cbe4-40d5-89b4-a4c5c9c5a845',TO_DATE('2014-07-01 14:53:41','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2014-07-01 14:53:41','YYYY-MM-DD HH24:MI:SS'),0,100,'Y',100,'ZK_DASHBOARD_PERFORMANCE_TIMEOUT',0,'D')
;
SELECT register_migration_script('201407011455_IDEMPIERE-2029.sql') FROM dual
;

View File

@ -0,0 +1,7 @@
-- Jul 1, 2014 2:53:42 PM SGT
-- IDEMPIERE-2029 Performance gadgets portlet is not sized correctly on login
INSERT INTO AD_SysConfig (AD_SysConfig_ID,ConfigurationLevel,Value,AD_SysConfig_UU,Updated,Created,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name,AD_Client_ID,EntityType) VALUES (200057,'C','500','70b3fe79-cbe4-40d5-89b4-a4c5c9c5a845',TO_TIMESTAMP('2014-07-01 14:53:41','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2014-07-01 14:53:41','YYYY-MM-DD HH24:MI:SS'),0,100,'Y',100,'ZK_DASHBOARD_PERFORMANCE_TIMEOUT',0,'D')
;
SELECT register_migration_script('201407011455_IDEMPIERE-2029.sql') FROM dual
;

View File

@ -125,6 +125,7 @@ public class MSysConfig extends X_AD_SysConfig
public static final String ZK_BROWSER_ICON = "ZK_BROWSER_ICON";
public static final String ZK_BROWSER_TITLE = "ZK_BROWSER_TITLE";
public static final String ZK_BUTTON_STYLE = "ZK_BUTTON_STYLE";
public static final String ZK_DASHBOARD_PERFORMANCE_TIMEOUT = "ZK_DASHBOARD_PERFORMANCE_TIMEOUT";
public static final String ZK_DASHBOARD_REFRESH_INTERVAL = "ZK_DASHBOARD_REFRESH_INTERVAL";
public static final String ZK_DECIMALBOX_PROCESS_DOTKEYPAD = "ZK_DECIMALBOX_PROCESS_DOTKEYPAD";
public static final String ZK_DESKTOP_CLASS = "ZK_DESKTOP_CLASS";
@ -682,4 +683,4 @@ public class MSysConfig extends X_AD_SysConfig
+"]";
}
} // MSysConfig;
} // MSysConfig;

View File

@ -15,6 +15,8 @@ package org.adempiere.webui.dashboard;
import org.adempiere.webui.apps.graph.WPAPanel;
import org.adempiere.webui.util.ServerPushTemplate;
import org.compiere.model.MSysConfig;
import org.compiere.util.Env;
import org.zkoss.zk.au.out.AuScript;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
@ -81,9 +83,10 @@ public class DPPerformance extends DashboardPanel {
removeAttribute(ON_POST_RENDER_ATTR);
if (this.getFirstChild() != null)
{
int timeout = MSysConfig.getIntValue(MSysConfig.ZK_DASHBOARD_PERFORMANCE_TIMEOUT, 500, Env.getAD_Client_ID(Env.getCtx()));
Component grid = this.getFirstChild().getFirstChild();
String script = "setTimeout(function() { var grid = jq('#" + grid.getUuid() + "');";
script = script + "grid.parent().height(grid.css('height'));}, 500);";
script = script + "grid.parent().height(grid.css('height'));}, " + timeout + ");";
if (Executions.getCurrent() != null)
Clients.response(new AuScript(script));
this.getFirstChild().invalidate();