diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/zkwebui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index 66b8ac0665..f6f1ea0751 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -193,10 +193,6 @@ public class AdempiereWebUI extends Window implements EventListener, IWebClient return appDesktop; } - public boolean isAsap() { - return true; - } - public void onEvent(Event event) { if (event instanceof ClientInfoEvent) { ClientInfoEvent c = (ClientInfoEvent)event; diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessDialog.java b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessDialog.java index 904bf326c1..a78adff99f 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessDialog.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessDialog.java @@ -123,14 +123,14 @@ public class ProcessDialog extends Window implements EventListener//, ASyncProce String label = Msg.getMsg(Env.getCtx(), "Ok"); bOK = new Button(label.replaceAll("&", "")); bOK.setImage("/images/Ok16.png"); - bOK.setName("ok"); + bOK.setId("Ok"); bOK.addEventListener(Events.ON_CLICK, this); hbox.appendChild(bOK); label = Msg.getMsg(Env.getCtx(), "Cancel"); Button btn = new Button(label.replaceAll("&", "")); btn.setImage("/images/Cancel16.png"); - btn.setName("cancel"); + btn.setId("Cancel"); btn.addEventListener(Events.ON_CLICK, this); hbox.appendChild(btn); @@ -298,20 +298,16 @@ public class ProcessDialog extends Window implements EventListener//, ASyncProce new Thread(runnable).start(); } - public boolean isAsap() { - return true; - } - public void onEvent(Event event) { Component component = event.getTarget(); if (component instanceof Button) { Button element = (Button)component; - if ("ok".equalsIgnoreCase(element.getName())) { + if ("Ok".equalsIgnoreCase(element.getId())) { if (element.getLabel().length() > 0) this.startProcess(); else this.dispose(); - } else if ("cancel".equalsIgnoreCase(element.getName())) { + } else if ("Cancel".equalsIgnoreCase(element.getId())) { this.dispose(); } } @@ -380,7 +376,9 @@ public class ProcessDialog extends Window implements EventListener//, ASyncProce .append("

"); m_messageText.append(pi.getLogInfo(true)); message.setContent(m_messageText.toString()); - //message.setCaretPosition(message.getDocument().getLength()); // scroll down + + bOK.setLabel(""); + m_ids = pi.getIDs(); //no longer needed, hide to give more space to display log diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java index 2fdfde67cb..7bbc8395eb 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java @@ -34,12 +34,14 @@ import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Msg; +import org.zkoss.zk.au.out.AuEcho; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.DesktopUnavailableException; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; +import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.Div; import org.zkoss.zul.Hbox; import org.zkoss.zul.Html; @@ -98,6 +100,7 @@ public class ProcessModalDialog extends Window implements EventListener } // ProcessDialog private void initComponents() { + this.setBorder("normal"); VerticalBox vbox = new VerticalBox(); Div div = new Div(); message = new Html(); @@ -109,18 +112,21 @@ public class ProcessModalDialog extends Window implements EventListener div.setAlign("right"); Hbox hbox = new Hbox(); Button btn = new Button("Ok"); - btn.setName("ok"); + btn.setSclass("action-text-button"); + btn.setId("Ok"); btn.addEventListener(Events.ON_CLICK, this); hbox.appendChild(btn); btn = new Button("Cancel"); - btn.setName("cancel"); + btn.setId("Cancel"); + btn.setSclass("action-text-button"); btn.addEventListener(Events.ON_CLICK, this); hbox.appendChild(btn); div.appendChild(hbox); vbox.appendChild(div); this.appendChild(vbox); + } private ASyncProcess m_ASyncProcess; @@ -143,6 +149,7 @@ public class ProcessModalDialog extends Window implements EventListener private ProcessParameterPanel parameterPanel = null; private ProcessInfo m_pi = null; + private ProcessRunnable m_processRunnable; /** @@ -159,12 +166,16 @@ public class ProcessModalDialog extends Window implements EventListener * Dispose */ public void dispose() - { + { parameterPanel.restoreContext(); m_valid = false; this.detach(); } // dispose + /** + * is dialog still valid + * @return boolean + */ public boolean isValid() { return m_valid; @@ -242,27 +253,38 @@ public class ProcessModalDialog extends Window implements EventListener } if (m_autoStart) { startProcess(); - dispose(); } } // Check if the process is a silent one if(isValid() && m_ShowHelp != null && m_ShowHelp.equals("S")) { - startProcess(); - dispose(); + startProcess(); } return true; } // init - public void startProcess() - { + /** + * launch process + */ + private void startProcess() + { + m_processRunnable = new ProcessRunnable(Executions.getCurrent().getDesktop()); m_pi.setPrintPreview(true); + if (m_ASyncProcess != null) { m_ASyncProcess.lockUI(m_pi); } - new Thread(new ProcessRunnable(Executions.getCurrent().getDesktop())).start(); + //use echo, otherwise lock ui wouldn't work + Clients.response(new AuEcho(this, "runProcessBackground", null)); + } + + /** + * internal use, don't call this directly + */ + public void runProcessBackground() { + new Thread(m_processRunnable).start(); } private class ProcessRunnable implements Runnable { @@ -282,7 +304,7 @@ public class ProcessModalDialog extends Window implements EventListener m_ASyncProcess.unlockUI(m_pi); } //release full control of desktop - Executions.deactivate(desktop); + Executions.deactivate(desktop); } } catch (DesktopUnavailableException e) { log.log(Level.SEVERE, e.getLocalizedMessage(), e); @@ -292,22 +314,19 @@ public class ProcessModalDialog extends Window implements EventListener } } - public boolean isAsap() { - return true; - } - + /** + * handle events + */ public void onEvent(Event event) { Component component = event.getTarget(); if (component instanceof Button) { Button element = (Button)component; - if ("ok".equalsIgnoreCase(element.getName())) { + if ("Ok".equalsIgnoreCase(element.getId())) { this.startProcess(); - this.dispose(); - } else if ("cancel".equalsIgnoreCase(element.getName())) { + } else if ("Cancel".equalsIgnoreCase(element.getId())) { this.dispose(); } - } - + } } } // ProcessDialog diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java index 0710e6d04b..4a5731a6f9 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java @@ -235,6 +235,7 @@ implements ValueChangeListener, IProcessParameter // The Editor WEditor wEditor = WebEditorFactory.getEditor(mField, false); wEditor.addValueChangeListener(this); + wEditor.dynamicDisplay(); // MField => VEditor - New Field value to be updated to editor mField.addPropertyChangeListener(wEditor); // Set Default @@ -257,6 +258,7 @@ implements ValueChangeListener, IProcessParameter WEditor wEditor2 = WebEditorFactory.getEditor(mField2, false); // New Field value to be updated to editor mField2.addPropertyChangeListener(wEditor2); + wEditor2.dynamicDisplay(); // Set Default Object defaultObject2 = mField2.getDefault(); mField2.setValue (defaultObject2, true); diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/WReport.java b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/WReport.java index 38bc236d29..4411296338 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/WReport.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/WReport.java @@ -233,10 +233,6 @@ public class WReport implements EventListener { return MTable.getTable_ID(tableName); } // getAD_Table_ID - public boolean isAsap() { - return true; - } - public void onEvent(Event event) { if(event.getTarget() instanceof Menuitem) { diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/component/CWindowToolbar.java b/zkwebui/WEB-INF/src/org/adempiere/webui/component/CWindowToolbar.java index 1e88172233..6dadeb499a 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/component/CWindowToolbar.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/component/CWindowToolbar.java @@ -483,11 +483,6 @@ public class CWindowToolbar extends FToolbar implements EventListener btnGridToggle.setDisabled(!enabled); } - public boolean isAsap() - { - return true; - } - public Event getEvent() { return event; diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditor.java index e3dce347ff..f14dbcd0bb 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditor.java @@ -407,11 +407,9 @@ public abstract class WEditor implements EventListener, PropertyChangeListener return this.mandatory; } - public boolean isAsap() - { - return true; - } - + /** + * allow subclass to perform dynamic loading of data + */ public void dynamicDisplay() { } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditorPopupMenu.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditorPopupMenu.java index 835e5902c1..64fd19b452 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditorPopupMenu.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WEditorPopupMenu.java @@ -128,11 +128,6 @@ public class WEditorPopupMenu extends Menupopup implements EventListener menuListeners.add(listener); } - public boolean isAsap() - { - return true; - } - public void onEvent(Event event) { String evt = (String)event.getTarget().getAttribute(EVENT_ATTRIBUTE); diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADForm.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADForm.java index af7a18a7c1..e3aabc098f 100755 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADForm.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADForm.java @@ -232,15 +232,6 @@ public abstract class ADForm extends Window implements EventListener } } // openForm - /** - * - * @return false - */ - public boolean isAsap() - { - return false; - } - /** * */ diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java index db9454c420..03b6b7ea14 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java @@ -634,11 +634,6 @@ DataStatusListener, ValueChangeListener, IADTabpanel }*/ } - public boolean isAsap() - { - return false; - } - public void onEvent(Event event) { if (event.getTarget() instanceof Toolbarbutton) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java index e9577c52c7..5eb9e123c4 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java @@ -469,11 +469,6 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To return false; } - public boolean isAsap() - { - return true; - } - // private void find() // { // MQuery mquery = new MQuery(curTab.getAD_Table_ID()); @@ -1380,31 +1375,35 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To && pi.isReportingProcess() == false; // // Process Result - if (notPrint) // refresh if not print - { - if (Executions.getCurrent() != null) + + if (Executions.getCurrent() != null) + { + if (notPrint) // refresh if not print { updateUI(pi); - Clients.showBusy(null, false); - } - else - { - try { - //get full control of desktop - Executions.activate(getComponent().getDesktop()); - try { - updateUI(pi); - Clients.showBusy(null, false); - } catch(Error ex){ - throw ex; - } finally{ - //release full control of desktop - Executions.deactivate(getComponent().getDesktop()); - } - } catch (Exception e) { - logger.log(Level.WARNING, "Failed to update UI upon unloc.", e); - } } + Clients.showBusy(null, false); + } + else + { + try { + //get full control of desktop + Executions.activate(getComponent().getDesktop()); + try { + if (notPrint) // refresh if not print + { + updateUI(pi); + } + Clients.showBusy(null, false); + } catch(Error ex){ + throw ex; + } finally{ + //release full control of desktop + Executions.deactivate(getComponent().getDesktop()); + } + } catch (Exception e) { + logger.log(Level.WARNING, "Failed to update UI upon unloc.", e); + } } } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java index 8fbe91ae46..68f5cf744c 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java @@ -497,11 +497,6 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl } // saveSelectionDetail - public boolean isAsap() - { - return true; - } - public void tableChanged(WTableModelEvent event) { diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java index ebc6186eab..fc5437864c 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LoginPanel.java @@ -216,9 +216,4 @@ public class LoginPanel extends Window implements EventListener wndLogin.loginOk(userId, userPassword); } } - - public boolean isAsap() - { - return true; - } } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LogoutPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LogoutPanel.java index 055411d7fe..07c2b9848b 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LogoutPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/LogoutPanel.java @@ -52,11 +52,6 @@ public class LogoutPanel extends Panel implements EventListener this.appendChild(btnLogOut); } - public boolean isAsap() - { - return true; - } - public void onEvent(Event event) { if (btnLogOut == event.getTarget()) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuPanel.java index 9ede4ef420..84b9da66d7 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuPanel.java @@ -229,11 +229,6 @@ public class MenuPanel extends Panel implements EventListener } } - public boolean isAsap() - { - return true; - } - public Tree getMenuTree() { return menuTree; diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuSearchPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuSearchPanel.java index c8c0ade65c..e9e0d71463 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuSearchPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/MenuSearchPanel.java @@ -98,12 +98,6 @@ public class MenuSearchPanel extends Panel implements EventListener cmbSearch.setDict(treeValues); } - public boolean isAsap() - { - return true; - } - - public void onEvent(Event event) { if (cmbSearch.equals(event.getTarget()) && (event.getName() != Events.ON_CHANGING)) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/RolePanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/RolePanel.java index ce87f65100..32f1620cee 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/RolePanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/RolePanel.java @@ -334,9 +334,4 @@ public class RolePanel extends Window implements EventListener } wndLogin.loginCompleted(); } - - public boolean isAsap() - { - return true; - } } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java index 6fa584d3d0..99b72f9c43 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java @@ -336,11 +336,6 @@ public class WDocActionPanel extends Window implements EventListener return index; } // getSelectedIndex - public boolean isAsap() - { - return true; - } - public int getNumberOfOptions() { return lstDocAction != null ? lstDocAction.getItemCount() : 0; } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index ee5088df89..fd454dbba3 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -631,6 +631,7 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe editor = WebEditorFactory.getEditor(mField, false); editor.setMandatory(false); editor.setReadWrite(true); + editor.dynamicDisplay(); Label label = editor.getLabel(); Component fieldLabel = editor.getComponent(); @@ -1182,6 +1183,7 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe m_editor.setValue(null); m_editor.setReadWrite(enabled); m_editor.setVisible(enabled); + m_editor.dynamicDisplay(); // return m_editor.getComponent(); diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java b/zkwebui/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java index 0cb7e78944..65d17ca984 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java @@ -477,6 +477,7 @@ public final class WAccountDialog extends Window m_row.appendChild(div); m_row.appendChild(editor.getComponent()); + editor.dynamicDisplay(); // m_newRow = !m_newRow; } // addLine