[ 1735618 ] GridTable error when there is no model generated

http://sourceforge.net/tracker/index.php?func=detail&aid=1735618&group_id=176962&atid=879332
This commit is contained in:
teo_sarca 2007-06-12 10:09:58 +00:00
parent 66edaf6eb8
commit 2e23edc9c9
1 changed files with 3 additions and 2 deletions

View File

@ -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
}