IDEMPIERE-522 Zk: Random Freeze of screen update. Fixed intermittent update issue after removal of in progress mask.

This commit is contained in:
Heng Sin Low 2012-12-29 07:13:19 +08:00
parent 2153268138
commit 14d41aaf33
5 changed files with 46 additions and 34 deletions

View File

@ -438,12 +438,12 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
GridTab pTab = gridWindow.getTab(entry.getKey()); GridTab pTab = gridWindow.getTab(entry.getKey());
Object[] value = entry.getValue(); Object[] value = entry.getValue();
MQuery pquery = new MQuery(pTab.getAD_Table_ID()); MQuery pquery = new MQuery(pTab.getAD_Table_ID());
pquery.addRestriction((String)value[0], "=", value[1]); pquery.addRestriction((String)value[0], "=", value[1]);
pTab.setQuery(pquery); pTab.setQuery(pquery);
IADTabpanel tp = adTabbox.findADTabpanel(pTab); IADTabpanel tp = adTabbox.findADTabpanel(pTab);
tp.createUI(); tp.createUI();
tp.query(); tp.query();
} }
MQuery targetQuery = new MQuery(gTab.getAD_Table_ID()); MQuery targetQuery = new MQuery(gTab.getAD_Table_ID());
targetQuery.addRestriction(gTab.getLinkColumnName(), "=", parentId); targetQuery.addRestriction(gTab.getLinkColumnName(), "=", parentId);
@ -866,11 +866,12 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
win.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() { win.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
Clients.clearBusy(getComponent()); Clients.clearBusy(getComponent().getParent());
getComponent().invalidate();
} }
}); });
getComponent().getParent().appendChild(win); getComponent().getParent().appendChild(win);
Clients.showBusy(getComponent(), " "); Clients.showBusy(getComponent().getParent(), " ");
LayoutUtils.openOverlappedWindow(getComponent(), win, "middle_center"); LayoutUtils.openOverlappedWindow(getComponent(), win, "middle_center");
} }
@ -906,11 +907,12 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
toolbar.getButton("Chat").setPressed(adTabbox.getSelectedGridTab().hasChat()); toolbar.getButton("Chat").setPressed(adTabbox.getSelectedGridTab().hasChat());
focusToActivePanel(); focusToActivePanel();
Clients.clearBusy(getComponent()); Clients.clearBusy(getComponent().getParent());
getComponent().invalidate();
} }
}); });
getComponent().getParent().appendChild(chat); getComponent().getParent().appendChild(chat);
Clients.showBusy(getComponent(), " "); Clients.showBusy(getComponent().getParent(), " ");
LayoutUtils.openOverlappedWindow(getComponent(), chat, "middle_center"); LayoutUtils.openOverlappedWindow(getComponent(), chat, "middle_center");
chat.showWindow(); chat.showWindow();
} }
@ -979,14 +981,15 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} }
else if (event.getTarget() instanceof ProcessModalDialog) else if (event.getTarget() instanceof ProcessModalDialog)
{ {
Clients.clearBusy(getComponent()); Clients.clearBusy(getComponent().getParent());
ProcessModalDialog dialog = (ProcessModalDialog) event.getTarget(); ProcessModalDialog dialog = (ProcessModalDialog) event.getTarget();
onModalClose(dialog.getProcessInfo()); onModalClose(dialog.getProcessInfo());
String s = breadCrumb.getStatusLine(); String s = breadCrumb.getStatusLine();
boolean b = breadCrumb.getStatusError(); boolean b = breadCrumb.getStatusError();
ProcessInfoLog[] logs = breadCrumb.getPLogs(); ProcessInfoLog[] logs = breadCrumb.getPLogs();
onRefresh(true, false); onRefresh(true, false);
breadCrumb.setStatusLine(s, b, logs); breadCrumb.setStatusLine(s, b, logs);
getComponent().invalidate();
} }
else if (ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT.equals(event.getName())) else if (ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT.equals(event.getName()))
{ {
@ -1577,7 +1580,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
findWindow.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() { findWindow.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
Clients.clearBusy(getComponent()); Clients.clearBusy(getComponent().getParent());
getComponent().invalidate();
if (!findWindow.isCancel()) if (!findWindow.isCancel())
{ {
MQuery query = findWindow.getQuery(); MQuery query = findWindow.getQuery();
@ -1605,7 +1609,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} }
findWindow.setTitle(null); findWindow.setTitle(null);
getComponent().getParent().appendChild(findWindow); getComponent().getParent().appendChild(findWindow);
Clients.showBusy(getComponent(), " "); Clients.showBusy(getComponent().getParent(), " ");
LayoutUtils.openOverlappedWindow(toolbar, findWindow, "after_start"); LayoutUtils.openOverlappedWindow(toolbar, findWindow, "after_start");
} }
@ -2050,11 +2054,12 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
focusToActivePanel(); focusToActivePanel();
Clients.clearBusy(getComponent()); Clients.clearBusy(getComponent().getParent());
getComponent().invalidate();
} }
}); });
getComponent().getParent().appendChild(messagePanel); getComponent().getParent().appendChild(messagePanel);
Clients.showBusy(getComponent(), " "); Clients.showBusy(getComponent().getParent(), " ");
LayoutUtils.openOverlappedWindow(getComponent(), messagePanel, "middle_center"); LayoutUtils.openOverlappedWindow(getComponent(), messagePanel, "middle_center");
} }
// //
@ -2086,7 +2091,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
if (dialog.isValid()) { if (dialog.isValid()) {
dialog.setWidth("500px"); dialog.setWidth("500px");
dialog.setBorder("normal"); dialog.setBorder("normal");
Clients.showBusy(getComponent(), " "); Clients.showBusy(getComponent().getParent(), " ");
getComponent().getParent().appendChild(dialog); getComponent().getParent().appendChild(dialog);
LayoutUtils.openOverlappedWindow(getComponent(), dialog, "middle_center"); LayoutUtils.openOverlappedWindow(getComponent(), dialog, "middle_center");
} }
@ -2358,8 +2363,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
getComponent().getParent().appendChild(win); getComponent().getParent().appendChild(win);
win.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() { win.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
Clients.clearBusy(getComponent()); Clients.clearBusy(getComponent().getParent());
if (!win.isStartProcess()) { getComponent().invalidate();
if (!win.isStartProcess()) {
return; return;
} }
boolean startWOasking = true; boolean startWOasking = true;
@ -2367,7 +2373,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
executeButtonProcess(wButton, startWOasking, table_ID, recordIdParam, isProcessMandatory); executeButtonProcess(wButton, startWOasking, table_ID, recordIdParam, isProcessMandatory);
} }
}); });
Clients.showBusy(getComponent(), " "); Clients.showBusy(getComponent().getParent(), " ");
LayoutUtils.openOverlappedWindow(getComponent(), win, "middle_center"); LayoutUtils.openOverlappedWindow(getComponent(), win, "middle_center");
return; return;
} }
@ -2383,7 +2389,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
{ {
if(cf.isInitOK()) if(cf.isInitOK())
{ {
Clients.showBusy(getComponent(), " "); Clients.showBusy(getComponent().getParent(), " ");
final WCreateFromWindow window = (WCreateFromWindow) cf.getWindow(); final WCreateFromWindow window = (WCreateFromWindow) cf.getWindow();
window.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, AdempiereIdGenerator.escapeId(window.getTitle())); window.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, AdempiereIdGenerator.escapeId(window.getTitle()));
window.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() { window.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
@ -2392,7 +2398,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
if (!window.isCancel()) { if (!window.isCancel()) {
onRefresh(true, false); onRefresh(true, false);
} }
Clients.clearBusy(getComponent()); Clients.clearBusy(getComponent().getParent());
getComponent().invalidate();
} }
}); });
getComponent().getParent().appendChild(window); getComponent().getParent().appendChild(window);
@ -2538,11 +2545,12 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
onRefresh(true, false); onRefresh(true, false);
Clients.clearBusy(getComponent()); Clients.clearBusy(getComponent().getParent());
getComponent().invalidate();
} }
}); });
getComponent().getParent().appendChild(form); getComponent().getParent().appendChild(form);
Clients.showBusy(getComponent(), " "); Clients.showBusy(getComponent().getParent(), " ");
LayoutUtils.openOverlappedWindow(getComponent(), form, "middle_center"); LayoutUtils.openOverlappedWindow(getComponent(), form, "middle_center");
} }
else { else {
@ -2557,7 +2565,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
{ {
dialog.setWidth("500px"); dialog.setWidth("500px");
dialog.setBorder("normal"); dialog.setBorder("normal");
Clients.showBusy(getComponent(), " "); Clients.showBusy(getComponent().getParent(), " ");
getComponent().getParent().appendChild(dialog); getComponent().getParent().appendChild(dialog);
LayoutUtils.openOverlappedWindow(getComponent(), dialog, "middle_center"); LayoutUtils.openOverlappedWindow(getComponent(), dialog, "middle_center");
} }
@ -2703,11 +2711,12 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
dialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() { dialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
Clients.clearBusy(getComponent()); Clients.clearBusy(getComponent().getParent());
getComponent().invalidate();
} }
}); });
getComponent().getParent().appendChild(dialog); getComponent().getParent().appendChild(dialog);
Clients.showBusy(getComponent(), " "); Clients.showBusy(getComponent().getParent(), " ");
LayoutUtils.openOverlappedWindow(this.getComponent(),dialog,"middle_center"); LayoutUtils.openOverlappedWindow(this.getComponent(),dialog,"middle_center");
} }

View File

@ -42,7 +42,6 @@ import org.compiere.util.Msg;
import org.zkoss.util.media.AMedia; import org.zkoss.util.media.AMedia;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.Clients; import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Div; import org.zkoss.zul.Div;
import org.zkoss.zul.Filedownload; import org.zkoss.zul.Filedownload;
@ -134,7 +133,7 @@ public class ExportAction implements EventListener<Event>
confirmPanel.addActionListener(this); confirmPanel.addActionListener(this);
} }
Clients.showBusy(panel.getComponent(), " "); Clients.showBusy(panel.getComponent().getParent(), " ");
panel.getComponent().getParent().appendChild(winExportFile); panel.getComponent().getParent().appendChild(winExportFile);
LayoutUtils.openOverlappedWindow(panel.getComponent(), winExportFile, "middle_center"); LayoutUtils.openOverlappedWindow(panel.getComponent(), winExportFile, "middle_center");
winExportFile.addEventListener(DialogEvents.ON_WINDOW_CLOSE, this); winExportFile.addEventListener(DialogEvents.ON_WINDOW_CLOSE, this);
@ -147,8 +146,8 @@ public class ExportAction implements EventListener<Event>
else if(event.getTarget().getId().equals(ConfirmPanel.A_OK)) else if(event.getTarget().getId().equals(ConfirmPanel.A_OK))
exportFile(); exportFile();
else if (event.getName().equals(DialogEvents.ON_WINDOW_CLOSE)) { else if (event.getName().equals(DialogEvents.ON_WINDOW_CLOSE)) {
Clients.clearBusy(panel.getComponent()); Clients.clearBusy(panel.getComponent().getParent());
Events.postEvent(new Event(LayoutUtils.ON_REDRAW_EVENT, panel.getComponent())); panel.getComponent().invalidate();
} }
} }

View File

@ -172,7 +172,7 @@ public class FileImportAction implements EventListener<Event>
confirmPanel.addActionListener(this); confirmPanel.addActionListener(this);
} }
Clients.showBusy(panel.getComponent(), " "); Clients.showBusy(panel.getComponent().getParent(), " ");
panel.getComponent().getParent().appendChild(winImportFile); panel.getComponent().getParent().appendChild(winImportFile);
LayoutUtils.openOverlappedWindow(panel.getComponent(), winImportFile, "middle_center"); LayoutUtils.openOverlappedWindow(panel.getComponent(), winImportFile, "middle_center");
winImportFile.addEventListener(DialogEvents.ON_WINDOW_CLOSE, this); winImportFile.addEventListener(DialogEvents.ON_WINDOW_CLOSE, this);
@ -202,8 +202,8 @@ public class FileImportAction implements EventListener<Event>
return; return;
importFile(); importFile();
} else if (event.getName().equals(DialogEvents.ON_WINDOW_CLOSE)) { } else if (event.getName().equals(DialogEvents.ON_WINDOW_CLOSE)) {
Clients.clearBusy(panel.getComponent()); Clients.clearBusy(panel.getComponent().getParent());
Events.postEvent(new Event(LayoutUtils.ON_REDRAW_EVENT, panel.getComponent())); panel.getComponent().invalidate();
} }
} }

View File

@ -57,6 +57,7 @@ import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Div; import org.zkoss.zul.Div;
import org.zkoss.zul.Filedownload; import org.zkoss.zul.Filedownload;
import org.zkoss.zul.Hbox; import org.zkoss.zul.Hbox;
import org.zkoss.zul.Tabpanel;
import org.zkoss.zul.Vbox; import org.zkoss.zul.Vbox;
/** /**
@ -173,7 +174,7 @@ public class ReportAction implements EventListener<Event>
winReport.onClose(); winReport.onClose();
else if(event.getTarget().getId().equals(ConfirmPanel.A_OK)) { else if(event.getTarget().getId().equals(ConfirmPanel.A_OK)) {
winReport.setVisible(false); winReport.setVisible(false);
Clients.showBusy(panel.getComponent(), null); Clients.showBusy(Msg.getMsg(Env.getCtx(), "Processing"));
Events.echoEvent("onValidate", winReport, null); Events.echoEvent("onValidate", winReport, null);
} }
else if(event.getTarget() == cboPrintFormat) else if(event.getTarget() == cboPrintFormat)
@ -189,7 +190,8 @@ public class ReportAction implements EventListener<Event>
cboExportType.setVisible(chkExport.isChecked()); cboExportType.setVisible(chkExport.isChecked());
else if (event.getName().equals("onValidate")) { else if (event.getName().equals("onValidate")) {
validate(); validate();
Clients.clearBusy(panel.getComponent()); Clients.clearBusy();
panel.getComponent().invalidate();
} }
} }
@ -298,8 +300,10 @@ public class ReportAction implements EventListener<Event>
private void print(ReportEngine re) private void print(ReportEngine re)
{ {
winReport.onClose(); winReport.onClose();
ReportCtl.preview(re); ReportCtl.preview(re);
Tabpanel tabPanel = (Tabpanel) panel.getComponent().getParent();
tabPanel.getLinkedTab().setSelected(true);
} }
private void export(ReportEngine re) private void export(ReportEngine re)

View File

@ -367,7 +367,7 @@ public class InvoicePrint extends SvrProcess
log.log(Level.SEVERE, e.getLocalizedMessage(), e); log.log(Level.SEVERE, e.getLocalizedMessage(), e);
} }
} else if (pdfList.size() > 0) { } else if (pdfList.size() > 0) {
Clients.clearBusy(null); Clients.clearBusy();
try { try {
Window win = new SimplePDFViewer(this.getName(), new FileInputStream(pdfList.get(0))); Window win = new SimplePDFViewer(this.getName(), new FileInputStream(pdfList.get(0)));
win.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED); win.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);