[ 2024474 ] UiException: You cannot access components belong to other de

This commit is contained in:
Heng Sin Low 2008-07-26 07:45:49 +00:00
parent a5927fa4f5
commit 1c792b2e0d
1 changed files with 18 additions and 12 deletions

View File

@ -132,30 +132,36 @@ public class AdempiereWebUI extends Window implements EventListener, IWebClient
{ {
ExecutionCarryOver eco = (ExecutionCarryOver) currSess.getAttribute("execution.carryover"); ExecutionCarryOver eco = (ExecutionCarryOver) currSess.getAttribute("execution.carryover");
if (eco != null) { if (eco != null) {
//try restore
appDesktop = (Desktop) d; appDesktop = (Desktop) d;
ExecutionCarryOver current = new ExecutionCarryOver(this.getPage().getDesktop()); ExecutionCarryOver current = new ExecutionCarryOver(this.getPage().getDesktop());
ExecutionCtrl ctrl = ExecutionsCtrl.getCurrentCtrl(); ExecutionCtrl ctrl = ExecutionsCtrl.getCurrentCtrl();
Visualizer vi = ctrl.getVisualizer(); Visualizer vi = ctrl.getVisualizer();
eco.carryOver(); eco.carryOver();
ctrl = ExecutionsCtrl.getCurrentCtrl(); try {
ctrl.setVisualizer(vi); ctrl = ExecutionsCtrl.getCurrentCtrl();
ctrl.setVisualizer(vi);
appDesktop.getComponent().detach();
} catch (Exception e) {
appDesktop = null;
} finally {
eco.cleanup();
current.carryOver();
}
appDesktop.getComponent().detach(); if (appDesktop != null) {
appDesktop.setPage(this.getPage());
eco.cleanup(); currSess.setAttribute("execution.carryover", current);
}
current.carryOver();
appDesktop.setPage(this.getPage());
currSess.setAttribute("execution.carryover", current);
} }
} }
if (appDesktop == null) if (appDesktop == null)
{ {
//create new desktop
appDesktop = new Desktop(); appDesktop = new Desktop();
appDesktop.setClientInfo(clientInfo); appDesktop.setClientInfo(clientInfo);
appDesktop.createPart(this.getPage()); appDesktop.createPart(this.getPage());