IDEMPIERE-55 Document type ** New ** pretends having been changed. Make consistent with web client behavior where ID and non-integer value is allow to be out of list.

(transplanted from e8d96477f7278aa426669f5f9e0d14e8fe1f2a04)
This commit is contained in:
Heng Sin Low 2011-09-06 07:45:30 +08:00
parent 033baccd24
commit 0e6ace57bf
1 changed files with 7 additions and 4 deletions

View File

@ -587,7 +587,7 @@ public class VLookup extends JComponent
m_text.setCaretPosition (0); // show beginning
notFound = m_lastDisplay.startsWith("<") && m_lastDisplay.endsWith(">");
}
if (notFound) // <key>
if (notFound && value instanceof Integer && m_lookup.getDisplayType() != DisplayType.ID) // for IDs is ok to be out of the list
{
m_value = null;
actionCombo (null); // data binding
@ -608,9 +608,12 @@ public class VLookup extends JComponent
// Not in Lookup - set to Null
if (m_combo.getSelectedItem() == null)
{
log.info(m_columnName + "=" + value + ": not in Lookup - set to NULL");
actionCombo (null); // data binding (calls setValue again)
m_value = null;
if (value instanceof Integer && m_lookup.getDisplayType() != DisplayType.ID) // for IDs is ok to be out of the list
{
log.info(m_columnName + "=" + value + ": not in Lookup - set to NULL");
actionCombo (null); // data binding (calls setValue again)
m_value = null;
}
}
}
m_settingValue = false;