From 2e23edc9c99efc7b7945f415e6424799b69dd1fd Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Tue, 12 Jun 2007 10:09:58 +0000 Subject: [PATCH] [ 1735618 ] GridTable error when there is no model generated http://sourceforge.net/tracker/index.php?func=detail&aid=1735618&group_id=176962&atid=879332 --- base/src/org/compiere/model/GridTable.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base/src/org/compiere/model/GridTable.java b/base/src/org/compiere/model/GridTable.java index 14555b3869..b1befa1324 100644 --- a/base/src/org/compiere/model/GridTable.java +++ b/base/src/org/compiere/model/GridTable.java @@ -1166,12 +1166,13 @@ public class GridTable extends AbstractTableModel // Update SQL with specific where clause StringBuffer select = new StringBuffer("SELECT "); - for (int i = 0; i < m_fields.size(); i++) + for (int i = 0, addedColumns = 0; i < m_fields.size(); i++) { GridField field = (GridField)m_fields.get(i); if (m_inserting && field.isVirtualColumn()) continue; - if (i > 0) + // Add "," if it is not the first added column - teo_sarca [ 1735618 ] + if (addedColumns++ > 0) select.append(","); select.append(field.getColumnSQL(true)); // ColumnName or Virtual Column }