From c19853b0adb454b48abecd40a93482229a0ffe62 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 2 Jul 2012 12:23:37 +0800 Subject: [PATCH] IDEMPIERE-152 Show UUID value on Record Info - Fixed issues with dataNew and dataIgnore --- .../src/org/compiere/model/GridTab.java | 17 ++++++++++++----- .../src/org/compiere/apps/APanel.java | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index a82ce19db8..1ebc4c1c8e 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -1116,6 +1116,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable public void dataIgnore() { log.fine("#" + m_vo.TabNo); + if (m_mTable.isInserting()) + { + m_currentRow--; + } m_mTable.dataIgnore(); setCurrentRow(m_currentRow, false); // re-load data @@ -2344,11 +2348,14 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable StringBuffer info = new StringBuffer(getTableName()); /* get UUID */ - PO po = m_mTable.getPO(m_currentRow); - if (po != null) { - String uuidcol = po.getUUIDColumnName(); - String uuid = po.get_ValueAsString(uuidcol); - info.append("\n ").append(uuidcol).append("=").append(uuid); + if (!e.isInserting() && e.getCurrentRow() >= 0) + { + 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 diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java index 3f194f80ef..ebdb54dccb 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java @@ -2098,6 +2098,7 @@ public final class APanel extends CPanel m_curAPanelTab.loadData(); } m_curTab.dataIgnore(); + m_curTab.dataRefresh(true); m_curGC.dynamicDisplay(0); } // cmd_ignore