IDEMPIERE-245 Strange behaviour for mandatory Date field which get the first focus
This commit is contained in:
parent
454626ee38
commit
1828616426
|
@ -1236,8 +1236,10 @@ public class GridController extends CPanel
|
||||||
int col = mTable.findColumn(e.getPropertyName());
|
int col = mTable.findColumn(e.getPropertyName());
|
||||||
//
|
//
|
||||||
if (e.getNewValue() == null && e.getOldValue() != null
|
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.setChanged (true);
|
||||||
|
mTable.setValueAt (e.getNewValue(), row, col, true);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// mTable.setValueAt (e.getNewValue(), row, col, true);
|
// mTable.setValueAt (e.getNewValue(), row, col, true);
|
||||||
|
|
|
@ -511,19 +511,7 @@ public class VDate extends JComponent
|
||||||
if (m_text == null || m_text.getText() == null)
|
if (m_text == null || m_text.getText() == null)
|
||||||
return;
|
return;
|
||||||
Object value = getValue();
|
Object value = getValue();
|
||||||
if (value == null && isMandatory() ) {
|
setValue(value);
|
||||||
// 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);
|
|
||||||
} // focusLost
|
} // focusLost
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue