* [ 1795685 ] Don't populate readonly lookup

- Fixed the refresh issue reported by Teo.
This commit is contained in:
Heng Sin Low 2007-09-16 17:07:22 +00:00
parent be8de7826f
commit 43f834d00e
1 changed files with 17 additions and 4 deletions

View File

@ -1205,10 +1205,23 @@ public class VLookup extends JComponent
//
Object obj = m_combo.getSelectedItem();
log.info(m_columnName + " #" + m_lookup.getSize() + ", Selected=" + obj);
m_lookup.refresh();
m_lookup.fillComboBox(isMandatory(), true, true, false);
m_combo.setSelectedItem(obj);
// m_combo.revalidate();
//no need to refresh readonly lookup, just remove direct cache
if (!isReadWrite())
{
m_settingValue = true; // disable actions
m_lookup.removeAllElements();
m_lastDisplay = m_lookup.getDisplay(m_value);
m_text.setText(m_lastDisplay);
m_text.setCaretPosition(0);
m_settingValue = false;
}
else
{
m_lookup.refresh();
m_lookup.fillComboBox(isMandatory(), true, true, false);
m_combo.setSelectedItem(obj);
//m_combo.revalidate();
}
//
setCursor(Cursor.getDefaultCursor());
log.info(m_columnName + " #" + m_lookup.getSize() + ", Selected=" + m_combo.getSelectedItem());