IDEMPIERE-2112:improve shortcuts for master detail data entry windows

fix esc key handle
This commit is contained in:
hieplq 2015-02-02 15:47:14 +07:00
parent 56ee761d61
commit c8004908e4
1 changed files with 6 additions and 6 deletions

View File

@ -249,7 +249,8 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
this.setMaximizable(true);
this.addEventListener(Events.ON_OK, this);
if (isLookup())
addEventListener(Events.ON_CANCEL, this);
contentPanel.setOddRowSclass(null);
// contentPanel.setSizedByContent(true);
contentPanel.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "infoListbox");
@ -1374,6 +1375,9 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
// do nothing when parameter not change and at window mode, or at dialog mode but select non record
onOk();
}
}else if (event.getName().equals(Events.ON_CANCEL)){
m_cancel = true;
dispose(false);
}
//when user push enter keyboard at input parameter field
else
@ -1395,10 +1399,6 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
}
} else if (keyEvent.getKeyCode() == VK_ENTER) { // Enter
// do nothing, let on_ok at infoWindo do, at this is too soon to get value from control, it's not bind
} else if (keyEvent.getKeyCode() == VK_ESCAPE) { // Escape
// Escape for cancel
m_cancel = true;
dispose(false);
}
}