IDEMPIERE-5520 Navigation between Tabs leave Detached DOM objects (Leak) (#1658)
IDEMPIERE-5559 Cannot find current Find Window - NullPointerException - Fix navigation error
This commit is contained in:
parent
9f71eeadbc
commit
560b9f4bad
|
@ -62,6 +62,8 @@ public class Window extends org.zkoss.zul.Window implements ISupportMask
|
|||
/*** Replace current tab content ***/
|
||||
public static final String REPLACE = "replace";
|
||||
|
||||
private boolean fireWindowCloseEventOnDetach = true;
|
||||
|
||||
public Window()
|
||||
{
|
||||
super();
|
||||
|
@ -83,7 +85,8 @@ public class Window extends org.zkoss.zul.Window implements ISupportMask
|
|||
super.onPageDetached(page);
|
||||
if (Executions.getCurrent() != null && Executions.getCurrent().getDesktop() != null &&
|
||||
Executions.getCurrent().getDesktop().getExecution() != null) {
|
||||
Events.sendEvent(this, new Event(DialogEvents.ON_WINDOW_CLOSE, this, null));
|
||||
if (fireWindowCloseEventOnDetach)
|
||||
Events.sendEvent(this, new Event(DialogEvents.ON_WINDOW_CLOSE, this, null));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,4 +149,20 @@ public class Window extends org.zkoss.zul.Window implements ISupportMask
|
|||
public Component getMaskComponent() {
|
||||
return showMaskWrapper.getMaskComponent();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return true if {@link DialogEvents#ON_WINDOW_CLOSE} event is fire when window is detach from page
|
||||
*/
|
||||
public boolean isFireWindowCloseEventOnDetach() {
|
||||
return fireWindowCloseEventOnDetach;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param fireWindowCloseEventOnDetach true to fire {@link DialogEvents#ON_WINDOW_CLOSE} event when window is detach from page (default is true)
|
||||
*/
|
||||
public void setFireWindowCloseEventOnDetach(boolean fireWindowCloseEventOnDetach) {
|
||||
this.fireWindowCloseEventOnDetach = fireWindowCloseEventOnDetach;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -353,6 +353,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
|
|||
LayoutUtils.addSclass("find-window", this);
|
||||
|
||||
addEventListener(Events.ON_CANCEL, e -> onCancel());
|
||||
setFireWindowCloseEventOnDetach(false);
|
||||
}
|
||||
|
||||
public boolean initialize()
|
||||
|
@ -2940,6 +2941,9 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* hide window and fire {@link DialogEvents#ON_WINDOW_CLOSE} event
|
||||
*/
|
||||
public void dispose()
|
||||
{
|
||||
// Find SQL
|
||||
|
|
Loading…
Reference in New Issue