IDEMPIERE-245 Strange behaviour for mandatory Date field which get the first focus

This commit is contained in:
Carlos Ruiz 2012-05-03 15:20:52 -05:00
parent 454626ee38
commit 1828616426
2 changed files with 4 additions and 14 deletions

View File

@ -1236,8 +1236,10 @@ public class GridController extends CPanel
int col = mTable.findColumn(e.getPropertyName());
//
if (e.getNewValue() == null && e.getOldValue() != null
&& e.getOldValue().toString().length() > 0) // some editors return "" instead of null
&& e.getOldValue().toString().length() > 0) { // some editors return "" instead of null
mTable.setChanged (true);
mTable.setValueAt (e.getNewValue(), row, col, true);
}
else
{
// mTable.setValueAt (e.getNewValue(), row, col, true);

View File

@ -511,19 +511,7 @@ public class VDate extends JComponent
if (m_text == null || m_text.getText() == null)
return;
Object value = getValue();
if (value == null && isMandatory() ) {
// teo_sarca [ 1660595 ] Date field: incorrect functionality on paste
// setValue(startCalendar(this, getTimestamp(), m_format, m_displayType, m_title));
Timestamp ts = startCalendar(this, getTimestamp(), m_format, m_displayType, m_title);
if (ts != null) {
setValue(ts);
}
else {
setValue(m_oldText);
}
}
else
setValue(value);
setValue(value);
} // focusLost
/**