IDEMPIERE-5778 - Focus is not set to Process Modal Dialog in Info Windows (#1916)

This commit is contained in:
Peter Takács 2023-06-29 04:56:43 +02:00 committed by GitHub
parent a0f1793719
commit 7b42d4acb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -994,6 +994,8 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI
protected void cancelProcess() protected void cancelProcess()
{ {
m_cancel = true; m_cancel = true;
if(getParent() != null && getParent() instanceof HtmlBasedComponent)
((HtmlBasedComponent)getParent()).focus();
this.dispose(); this.dispose();
} }

View File

@ -36,6 +36,7 @@ import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.compiere.util.Trx; import org.compiere.util.Trx;
import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
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;
@ -132,7 +133,7 @@ public class WProcessCtl extends AbstractProcessCtl {
para.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED); para.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
AEnv.showWindow(para); AEnv.showWindow(para);
} }
Executions.schedule(para.getDesktop(), e -> para.focus(), new Event("onPostShowProcessModalDialog"));
} }
} // execute } // execute