From 1a113b9cb5890a0a311d35d81f3745148eb45b5e Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 29 Oct 2013 17:55:26 +0800 Subject: [PATCH] 1003404 IDEMPIERE-1483 Performance problems (Time Out) when creating new records --- .../src/org/compiere/model/GridTab.java | 11 -------- .../adempiere/webui/window/WRecordInfo.java | 28 ++++++++++++++++++- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index ef267eb1a0..a4b516641f 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -2289,17 +2289,6 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable // Info StringBuilder info = new StringBuilder(getTableName()); - /* get UUID */ - if (!e.isInserting() && e.getCurrentRow() >= 0 && e.getCurrentRow() < e.getTotalRows()) - { - PO po = m_mTable.getPO(e.getCurrentRow()); - if (po != null) { - String uuidcol = po.getUUIDColumnName(); - String uuid = po.get_ValueAsString(uuidcol); - info.append("\n ").append(uuidcol).append("=").append(uuid); - } - } - // We have a key column if (m_keyColumnName != null && m_keyColumnName.length() > 0) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordInfo.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordInfo.java index d74e640af9..ba8643d008 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordInfo.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordInfo.java @@ -33,6 +33,8 @@ import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.component.Window; import org.compiere.model.DataStatusEvent; +import org.compiere.model.GridTab; +import org.compiere.model.GridTable; import org.compiere.model.MChangeLog; import org.compiere.model.MColumn; import org.compiere.model.MLookup; @@ -40,12 +42,14 @@ import org.compiere.model.MLookupFactory; import org.compiere.model.MRole; import org.compiere.model.MTable; import org.compiere.model.MUser; +import org.compiere.model.PO; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.NamePair; +import org.compiere.util.Util; import org.zkoss.zhtml.Pre; import org.zkoss.zhtml.Text; import org.zkoss.zk.ui.event.Event; @@ -211,7 +215,29 @@ public class WRecordInfo extends Window implements EventListener .append(" - ").append(m_dateTimeFormat.format(dse.Updated)).append("\n"); } if (dse.Info != null && dse.Info.length() > 0) - m_info.append("\n (").append(dse.Info).append(")"); + m_info.append("\n ").append(dse.Info).append(""); + + //get uuid + GridTable gridTable = null; + if (dse.getSource() instanceof GridTab) + { + GridTab gridTab = (GridTab) dse.getSource(); + gridTable = gridTab.getTableModel(); + } + else if (dse.getSource() instanceof GridTable) + { + gridTable = (GridTable) dse.getSource(); + } + if (gridTable != null && dse.getCurrentRow() >= 0 && dse.getCurrentRow() < gridTable.getRowCount()) + { + PO po = gridTable.getPO(dse.getCurrentRow()); + if (po != null) { + String uuidcol = po.getUUIDColumnName(); + String uuid = po.get_ValueAsString(uuidcol); + if (!Util.isEmpty(uuid)) + m_info.append("\n ").append(uuidcol).append("=").append(uuid); + } + } // Title if (dse.AD_Table_ID != 0)