[ 1730452 ] Autocompletion on comboboxes

This commit is contained in:
Heng Sin Low 2007-06-07 08:48:49 +00:00
parent 459f990d65
commit acd88e6e6e
2 changed files with 18 additions and 4 deletions

View File

@ -60,6 +60,8 @@ public abstract class Lookup extends AbstractListModel
private int m_displayType; private int m_displayType;
/** Window No */ /** Window No */
private int m_WindowNo; private int m_WindowNo;
private boolean m_mandatory;
/** /**
* Get Display Type * Get Display Type
@ -264,7 +266,7 @@ public abstract class Lookup extends AbstractListModel
// may cause delay *** The Actual Work *** // may cause delay *** The Actual Work ***
p_data = getData (mandatory, onlyValidated, onlyActive, temporary); p_data = getData (mandatory, onlyValidated, onlyActive, temporary);
// Selected Object changed // Selected Object changed
if (obj != m_selectedObject) if (obj != m_selectedObject)
{ {
@ -287,6 +289,8 @@ public abstract class Lookup extends AbstractListModel
else else
log.fine(getColumnName() + ": #" + p_data.size() + " - ms=" log.fine(getColumnName() + ": #" + p_data.size() + " - ms="
+ String.valueOf(System.currentTimeMillis()-startTime)); + String.valueOf(System.currentTimeMillis()-startTime));
} // fillComboBox } // fillComboBox
/** /**
@ -453,5 +457,15 @@ public abstract class Lookup extends AbstractListModel
public void loadComplete() public void loadComplete()
{ {
} // loadComplete } // loadComplete
public void setMandatory(boolean flag)
{
m_mandatory = flag;
}
public boolean isMandatory()
{
return m_mandatory;
}
} // Lookup } // Lookup

View File

@ -198,8 +198,8 @@ public final class MLookup extends Lookup implements Serializable
&& !m_info.IsParent && !m_info.IsParent
&& m_info.DisplayType != DisplayType.Search) && m_info.DisplayType != DisplayType.Search)
{ {
m_loader = new MLoader(); fillComboBox(isMandatory(), true, true, false);
m_loader.run(); // sync! loadComplete();
retValue = (NamePair)m_lookup.get(key); retValue = (NamePair)m_lookup.get(key);
if (retValue != null) if (retValue != null)
return retValue; return retValue;
@ -603,7 +603,7 @@ public final class MLookup extends Lookup implements Serializable
// if (m_info.KeyColumn.indexOf("C_InvoiceLine_ID") != -1) // if (m_info.KeyColumn.indexOf("C_InvoiceLine_ID") != -1)
// log.info(m_info.KeyColumn); // log.info(m_info.KeyColumn);
} // Loader } // Loader
private long m_startTime = System.currentTimeMillis(); private long m_startTime = System.currentTimeMillis();
/** /**