IDEMPIERE-1442 Additional confirmation on close and void action. Shouldn't pass document action value back to the document window until user have confirm the action.
This commit is contained in:
parent
d19475f4bf
commit
74f6661322
|
@ -306,12 +306,9 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
|
||||||
{
|
{
|
||||||
if (confirmPanel.getButton("Ok").equals(event.getTarget()))
|
if (confirmPanel.getButton("Ok").equals(event.getTarget()))
|
||||||
{
|
{
|
||||||
m_OKpressed = true;
|
|
||||||
setValue();
|
|
||||||
MClientInfo clientInfo = MClientInfo.get(Env.getCtx());
|
MClientInfo clientInfo = MClientInfo.get(Env.getCtx());
|
||||||
if(clientInfo.isConfirmOnDocClose() || clientInfo.isConfirmOnDocVoid())
|
if(clientInfo.isConfirmOnDocClose() || clientInfo.isConfirmOnDocVoid())
|
||||||
{
|
{
|
||||||
final Window window = this;
|
|
||||||
String selected = lstDocAction.getSelectedItem().getValue().toString();
|
String selected = lstDocAction.getSelectedItem().getValue().toString();
|
||||||
if((selected.equals(org.compiere.process.DocAction.ACTION_Close) && clientInfo.isConfirmOnDocClose())
|
if((selected.equals(org.compiere.process.DocAction.ACTION_Close) && clientInfo.isConfirmOnDocClose())
|
||||||
|| (selected.equals(org.compiere.process.DocAction.ACTION_Void) && clientInfo.isConfirmOnDocVoid()))
|
|| (selected.equals(org.compiere.process.DocAction.ACTION_Void) && clientInfo.isConfirmOnDocVoid()))
|
||||||
|
@ -323,17 +320,23 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
|
||||||
@Override
|
@Override
|
||||||
public void onCallback(Boolean result) {
|
public void onCallback(Boolean result) {
|
||||||
if(result)
|
if(result)
|
||||||
window.detach();
|
{
|
||||||
|
setValueAndClose();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this.detach();
|
{
|
||||||
|
setValueAndClose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this.detach();
|
{
|
||||||
|
setValueAndClose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (confirmPanel.getButton("Cancel").equals(event.getTarget()))
|
else if (confirmPanel.getButton("Cancel").equals(event.getTarget()))
|
||||||
{
|
{
|
||||||
|
@ -351,6 +354,12 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setValueAndClose() {
|
||||||
|
m_OKpressed = true;
|
||||||
|
setValue();
|
||||||
|
detach();
|
||||||
|
}
|
||||||
|
|
||||||
private void setValue()
|
private void setValue()
|
||||||
{
|
{
|
||||||
int index = getSelectedIndex();
|
int index = getSelectedIndex();
|
||||||
|
|
Loading…
Reference in New Issue