From 91eae000d305822741a9b515b76ffa5dcf19fb49 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 1 Mar 2007 13:46:28 +0000 Subject: [PATCH] * [ 1671709 ] Dynamic combobox initial size and refresh error --- client/src/org/compiere/grid/ed/VLookup.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/src/org/compiere/grid/ed/VLookup.java b/client/src/org/compiere/grid/ed/VLookup.java index 8f3af66fc3..3f1b94eea1 100644 --- a/client/src/org/compiere/grid/ed/VLookup.java +++ b/client/src/org/compiere/grid/ed/VLookup.java @@ -1179,7 +1179,10 @@ public class VLookup extends JComponent if (e.getSource() != m_combo || e.isTemporary() || m_haveFocus || m_lookup == null) return; if (m_lookup.isValidated() && !m_lookup.hasInactive()) + { + m_haveFocus = true; return; + } // m_haveFocus = true; // prevents calling focus gained twice m_settingFocus = true; // prevents actionPerformed @@ -1188,7 +1191,14 @@ public class VLookup extends JComponent log.config(m_columnName + " - Start Count=" + m_combo.getItemCount() + ", Selected=" + obj); // log.fine( "VLookupHash=" + this.hashCode()); + boolean popupVisible = m_combo.isPopupVisible(); m_lookup.fillComboBox(isMandatory(), true, true, true); // only validated & active & temporary + if (popupVisible) + { + //refresh + m_combo.hidePopup(); + m_combo.showPopup(); + } log.config(m_columnName + " - Update Count=" + m_combo.getItemCount() + ", Selected=" + m_lookup.getSelectedItem()); m_lookup.setSelectedItem(obj); @@ -1228,7 +1238,10 @@ public class VLookup extends JComponent if (e.getSource() != m_combo) return; if (m_lookup.isValidated() && !m_lookup.hasInactive()) + { + m_haveFocus = false; return; + } // m_settingFocus = true; // prevents actionPerformed //