Skip to content

Commit

Permalink
Added Shortcut for calling Product Dialog in zk (Alt+i)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raul-mz committed Jan 21, 2016
1 parent 45ecd07 commit de2ddcb
Showing 1 changed file with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void init() {

Keylistener keyListener = new Keylistener();
fieldProductName.appendChild(keyListener);
keyListener.setCtrlKeys("#f2#f3#f4#f9#f10@b@#left@#right^l");
keyListener.setCtrlKeys("#f2#f3#f4#f9#f10@b@#left@#right^l@i");
keyListener.addEventListener(Events.ON_CTRL_KEY, posPanel);
keyListener.addEventListener(Events.ON_CTRL_KEY, this);
keyListener.setAutoBlur(false);
Expand Down Expand Up @@ -333,18 +333,7 @@ private void findProduct()
}
else // more than one
{
WQueryProduct qt = new WQueryProduct(posPanel);
qt.setResults(results);
qt.setQueryData(posPanel.getM_PriceList_Version_ID(), posPanel.getM_Warehouse_ID());
AEnv.showWindow(qt);
Object[] result = qt.getSelectedKeys();
if(result == null)
return;

for(Object item : result) {
fieldProductName.setText(fieldProductName.getTitle());
posPanel.addLine((Integer)item, Env.ONE);
}
showWindowProduct(results);
}
} // findProduct

Expand Down Expand Up @@ -434,6 +423,11 @@ else if (keyEvent.getKeyCode() == 76 ) {
dispose();
return;
}
//Alt+I == 73
else if (keyEvent.getKeyCode() == 73 ) {
showWindowProduct(null);
return;
}
}
if(e.getTarget().equals(fieldProductName.getComponent(WPOSTextField.SECONDARY))
&& e.getName().equals(Events.ON_FOCUS) && !isKeyboard){
Expand Down Expand Up @@ -488,7 +482,25 @@ else if (e.getTarget().equals(buttonCancel)){
posPanel.refreshPanel();

}


/**
* Show Window Product
*/
private void showWindowProduct(MWarehousePrice[] p_results) {
WQueryProduct qt = new WQueryProduct(posPanel);
if(p_results != null)
qt.setResults(p_results);
qt.setQueryData(posPanel.getM_PriceList_Version_ID(), posPanel.getM_Warehouse_ID());
AEnv.showWindow(qt);
Object[] result = qt.getSelectedKeys();
if(result == null)
return;

for(Object item : result) {
fieldProductName.setText(fieldProductName.getTitle());
posPanel.addLine((Integer)item, Env.ONE);
}
}
@Override
public void refreshPanel() {

Expand Down

0 comments on commit de2ddcb

Please sign in to comment.