* [ 1795685 ] Don't populate readonly lookup

This commit is contained in:
Heng Sin Low 2007-09-16 08:45:35 +00:00
parent 22232d8ee1
commit 01275897b7
1 changed files with 10 additions and 2 deletions

View File

@ -179,8 +179,9 @@ public class VLookup extends JComponent
// *** VComboBox *** // *** VComboBox ***
if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search) // No Search if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search) // No Search
{ {
// Memory Leak after executing the next two lines ?? // Don't have to fill up combobox if it is readonly
m_lookup.fillComboBox (isMandatory(), true, true, false); if (!isReadOnly && isUpdateable)
m_lookup.fillComboBox (isMandatory(), true, true, false);
m_combo.setModel(m_lookup); m_combo.setModel(m_lookup);
// //
AutoCompletion.enable(m_combo); AutoCompletion.enable(m_combo);
@ -1339,6 +1340,13 @@ public class VLookup extends JComponent
{ {
if (m_lookup == null) if (m_lookup == null)
return -1; return -1;
//no need to refresh readonly lookup, just remove direct cache
if (!isReadWrite()) {
m_lookup.removeAllElements();
return 0;
}
return m_lookup.refresh(); return m_lookup.refresh();
} // refresh } // refresh