From 506e1eb6fd29f3bc265f412e03427ef625865e31 Mon Sep 17 00:00:00 2001 From: "Hesham S. Ahmed" Date: Thu, 20 Dec 2012 11:25:51 -0500 Subject: [PATCH] IDEMPIERE-524 Product Info Windows, Description Tab does not show DocumentNote --- .../org/compiere/apps/search/InfoProduct.java | 24 +++++++++++++++---- .../webui/panel/InfoProductPanel.java | 22 ++++++++++++++--- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java index 0193a07845..3cb00f4ef1 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java @@ -437,8 +437,26 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener pstmt = DB.prepareStatement(sql, null); pstmt.setString(1, (String)obj); rs = pstmt.executeQuery(); - fieldDescription.setText(""); warehouseTbl.loadTable(rs); + } + catch (Exception e) + { + log.log(Level.WARNING, sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + + m_M_Product_ID = getSelectedRowKey(); + sql = "SELECT DocumentNote FROM M_Product WHERE M_Product_ID = ?;"; + + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, m_M_Product_ID); + fieldDescription.setText(""); rs = pstmt.executeQuery(); if(rs.next()) if(rs.getString("DocumentNote") != null) @@ -453,9 +471,7 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener DB.close(rs, pstmt); rs = null; pstmt = null; } - - m_M_Product_ID = getSelectedRowKey(); - + sql = m_sqlSubstitute; log.finest(sql); try { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java index c77ac30891..8dfc36db74 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java @@ -673,8 +673,26 @@ public class InfoProductPanel extends InfoPanel implements EventListener pstmt = DB.prepareStatement(sql, null); pstmt.setString(1, (String)obj); rs = pstmt.executeQuery(); - fieldDescription.setText(""); warehouseTbl.loadTable(rs); + } + catch (Exception e) + { + log.log(Level.WARNING, sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; + } + + m_M_Product_ID = getSelectedRowKey(); + sql = "SELECT DocumentNote FROM M_Product WHERE M_Product_ID = ?;"; + + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, m_M_Product_ID); + fieldDescription.setText(""); rs = pstmt.executeQuery(); if(rs.next()) if(rs.getString("DocumentNote") != null) @@ -690,8 +708,6 @@ public class InfoProductPanel extends InfoPanel implements EventListener rs = null; pstmt = null; } - m_M_Product_ID = getSelectedRowKey(); - sql = m_sqlSubstitute; log.finest(sql); try {