From 1828616426fa409e228b9e8ff61b0dad92c1d19b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 3 May 2012 15:20:52 -0500 Subject: [PATCH] IDEMPIERE-245 Strange behaviour for mandatory Date field which get the first focus --- .../src/org/compiere/grid/GridController.java | 4 +++- .../src/org/compiere/grid/ed/VDate.java | 14 +------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/GridController.java b/org.adempiere.ui.swing/src/org/compiere/grid/GridController.java index a67d885bc1..d02fc22c4d 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/GridController.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/GridController.java @@ -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); diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java index 46804129e0..94f157817b 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java @@ -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 /**