[ 1805503 ] UI allows changing record while new record not saved

This commit is contained in:
Heng Sin Low 2008-01-14 02:26:50 +00:00
parent 2a14e6d2d0
commit 271966a547
2 changed files with 13 additions and 3 deletions

View File

@ -2065,10 +2065,19 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
// Row range check
int newRow = verifyRow(targetRow);
// Check, if we have old uncommitted data
m_mTable.dataSave(newRow, false);
if (m_mTable.dataSave(newRow, false) == false)
return m_currentRow;
//remove/ignore new and unchange row
if (m_mTable.isInserting())
{
if (newRow > m_currentRow)
newRow--;
dataIgnore();
}
// new position
return setCurrentRow(newRow, true);
} // navigate

View File

@ -870,7 +870,8 @@ public class GridTable extends AbstractTableModel
// Can we edit?
if (!m_open || m_readOnly // not accessible
|| row < 0 || col < 0 // invalid index
|| m_rowCount == 0) // no rows
|| m_rowCount == 0 // no rows
|| row >= m_rowCount ) //invalid row
{
log.finest("r=" + row + " c=" + col + " - R/O=" + m_readOnly + ", Rows=" + m_rowCount + " - Ignored");
return;