From 8d5a15aa34952f1705e445343734a13aea4ed5c5 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 26 Mar 2019 21:22:24 -0300 Subject: [PATCH] IDEMPIERE-2152 - fix error when Info Window has a non-displayed key and a process -> InfoWindow.getColumnValue: column play keyView should is integer --- .../src/org/adempiere/webui/panel/InfoPanel.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java index e71a68e8f0..705fdc65b9 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java @@ -81,6 +81,7 @@ import org.compiere.model.X_AD_CtxHelp; import org.compiere.process.ProcessInfo; import org.compiere.util.CLogger; import org.compiere.util.DB; +import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.KeyNamePair; import org.compiere.util.Msg; @@ -718,10 +719,17 @@ public abstract class InfoPanel extends Window implements EventListener, continue; MInfoColumn infoColumnAppend = (MInfoColumn) modelHasInfoColumn.getAD_InfoColumn(); - //TODO: improve read data to get data by data type of column. - String appendData = null; + Object appendData = null; try { - appendData = rs.getString(infoColumnAppend.getColumnName()); + if (DisplayType.isID(infoColumnAppend.getAD_Reference_ID())) { + appendData = rs.getInt(infoColumnAppend.getColumnName()); + } else if (DisplayType.isDate(infoColumnAppend.getAD_Reference_ID())) { + appendData = rs.getTimestamp(infoColumnAppend.getColumnName()); + } else if (DisplayType.isNumeric(infoColumnAppend.getAD_Reference_ID())) { + appendData = rs.getBigDecimal(infoColumnAppend.getColumnName()); + } else { + appendData = rs.getString(infoColumnAppend.getColumnName()); + } } catch (SQLException e) { appendData = null; } @@ -1406,7 +1414,7 @@ public abstract class InfoPanel extends Window implements EventListener, if (keyColumValue instanceof Integer){ keyValue = (Integer)keyColumValue; }else { - String msg = "column play keyView should is integer"; + String msg = "keyView column must be integer"; AdempiereException ex = new AdempiereException (msg); log.severe(msg); throw ex;