IDEMPIERE-474 Zk: Busy dialog sometime not dismissed after multiple execution of button action

This commit is contained in:
Heng Sin Low 2012-10-28 11:58:17 +08:00
parent 85df60640e
commit bf630f1907
2 changed files with 18 additions and 1 deletions

View File

@ -308,6 +308,10 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
ctx.put(ZK_DESKTOP_SESSION_KEY, this.getPage().getDesktop());
}
//ensure server push is on
if (!this.getPage().getDesktop().isServerPushEnabled())
this.getPage().getDesktop().enableServerPush(true);
//update session context
currSess.setAttribute(SessionContextListener.SESSION_CTX, ServerContext.getCurrentInstance());

View File

@ -447,9 +447,22 @@ public class ProcessModalDialog extends Window implements EventListener<Event>,
@Override
public void unlockUI(ProcessInfo pi) {
if (!isLocked || Executions.getCurrent() == null)
if (!isLocked)
return;
if (Executions.getCurrent() == null) {
Executions.schedule(getDesktop(), new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
doUnlockUI();
}
}, new Event("onUnLockUI"));
} else {
doUnlockUI();
}
}
private void doUnlockUI() {
hideBusyDialog();
isLocked = false;
}