IDEMPIERE-3973 Bug in Business Partner Info window export function

This commit is contained in:
Carlos Ruiz 2019-05-18 14:55:11 +02:00
parent f0a1c63495
commit adac5357f4
1 changed files with 26 additions and 6 deletions

View File

@ -2628,23 +2628,43 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
{ {
Object val = null; Object val = null;
int columnIndex = 1;
int colFound = 0;
for (int idx = 0; idx < getColumnCount(); idx++) {
if (isColumnPrinted(idx)) {
columnIndex++;
colFound++;
if (colFound >= col) {
break;
}
if (columnInfos[idx].isKeyPairCol()) {
columnIndex++;
}
}
}
try try
{ {
val = m_rs.getObject(col + 1); // Col are zero-based, while resultset col are 1 based val = m_rs.getObject(columnIndex);
if (columnInfos[col].isKeyPairCol()) {
m_rs.getObject(columnIndex+1);
if (m_rs.wasNull()) {
val = null;
}
}
} }
catch(SQLException e) catch(SQLException e)
{ {
throw new AdempiereException(e); throw new AdempiereException(e);
} }
/* not required - the info window splits the column in key name pairs
GridField gridField = columnInfos[col].getGridField(); GridField gridField = columnInfos[col].getGridField();
Lookup lookup = gridField.getLookup(); Lookup lookup = gridField.getLookup();
if (val != null && lookup != null)
if (lookup != null)
{ {
val = lookup.getDisplay(val); val = lookup.getDisplay(val);
} }
*/
return val; return val;
} }