diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java index 5888e9b596..cb3b723598 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java @@ -305,13 +305,10 @@ public class WDocActionPanel extends Window implements EventListener, Dia if (Events.ON_CLICK.equals(event.getName())) { if (confirmPanel.getButton("Ok").equals(event.getTarget())) - { - m_OKpressed = true; - setValue(); + { MClientInfo clientInfo = MClientInfo.get(Env.getCtx()); if(clientInfo.isConfirmOnDocClose() || clientInfo.isConfirmOnDocVoid()) { - final Window window = this; String selected = lstDocAction.getSelectedItem().getValue().toString(); if((selected.equals(org.compiere.process.DocAction.ACTION_Close) && clientInfo.isConfirmOnDocClose()) || (selected.equals(org.compiere.process.DocAction.ACTION_Void) && clientInfo.isConfirmOnDocVoid())) @@ -323,17 +320,23 @@ public class WDocActionPanel extends Window implements EventListener, Dia @Override public void onCallback(Boolean result) { if(result) - window.detach(); + { + setValueAndClose(); + } else return; } }); } else - this.detach(); + { + setValueAndClose(); + } } else - this.detach(); + { + setValueAndClose(); + } } else if (confirmPanel.getButton("Cancel").equals(event.getTarget())) { @@ -351,6 +354,12 @@ public class WDocActionPanel extends Window implements EventListener, Dia } } + private void setValueAndClose() { + m_OKpressed = true; + setValue(); + detach(); + } + private void setValue() { int index = getSelectedIndex();