[ 2165611 ] Zoom fields cannot be cleared

This commit is contained in:
Heng Sin Low 2008-10-15 04:50:08 +00:00
parent e4bee4874b
commit d0381a18c2
1 changed files with 7 additions and 13 deletions

View File

@ -430,13 +430,9 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
private void actionButton(String queryValue) private void actionButton(String queryValue)
{ {
// m_button.setEnabled(false); // disable double click
if (lookup == null) if (lookup == null)
return; // leave button disabled return; // leave button disabled
//m_text.requestFocus(); // closes other editors
/** /**
* Three return options: * Three return options:
* - Value Selected & OK pressed => store result => result has value * - Value Selected & OK pressed => store result => result has value
@ -444,8 +440,8 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
* - Window closed -> ignore => result == null && !cancalled * - Window closed -> ignore => result == null && !cancalled
*/ */
Object result = null; // Not Being Used Object result = null;
boolean cancelled = false; // Not Being Used boolean cancelled = false;
String col = lookup.getColumnName(); // fully qualified name String col = lookup.getColumnName(); // fully qualified name
@ -485,6 +481,9 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
ip.addValueChangeListener(this); ip.addValueChangeListener(this);
infoPanel = ip; infoPanel = ip;
AEnv.showWindow(ip); AEnv.showWindow(ip);
cancelled = ip.isCancelled();
result = ip.getSelectedKey();
} }
else if (col.equals("C_BPartner_ID")) else if (col.equals("C_BPartner_ID"))
{ {
@ -508,10 +507,8 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
infoPanel = ip; infoPanel = ip;
AEnv.showWindow(ip); AEnv.showWindow(ip);
/*
cancelled = ip.isCancelled(); cancelled = ip.isCancelled();
result = ip.getSelectedKey(); result = ip.getSelectedKey();
*/
} }
else // General Info else // General Info
{ {
@ -544,20 +541,17 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
// Result // Result
if (result != null) if (result != null)
{ {
// log.config(gridField.getColumnName() + " - Result = " + result.toString() + " (" + result.getClass().getName() + ")"); //ensure data binding happen
// make sure that value is in cache
lookup.getDirect(result, false, true);
actionCombo (result); // data binding actionCombo (result); // data binding
} }
else if (cancelled) else if (cancelled)
{ {
log.config(getColumnName() + " - Result = null (cancelled)"); log.config(getColumnName() + " - Result = null (cancelled)");
// actionCombo(null); actionCombo(null);
} }
else else
{ {
log.config(getColumnName() + " - Result = null (not cancelled)"); log.config(getColumnName() + " - Result = null (not cancelled)");
// setValue(m_value); // to re-display value
} }
} }