mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 03:38:33 +08:00
PL-7289 Implementing Committable in a browser controller does not affect showing message about unsaved changes
This commit is contained in:
parent
901fc78150
commit
8707986f80
@ -396,8 +396,8 @@ public class DesktopWindow implements Window, Component.Disposable,
|
||||
return res;
|
||||
}
|
||||
|
||||
protected boolean isModified() {
|
||||
return getDsContext() != null && getDsContext().isModified();
|
||||
public boolean isModified() {
|
||||
return delegate.isModified();
|
||||
}
|
||||
|
||||
private void stopTimers() {
|
||||
@ -1498,11 +1498,6 @@ public class DesktopWindow implements Window, Component.Disposable,
|
||||
return delegate.getDatasource();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return ((EditorWindowDelegate) delegate).isModified();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean commit() {
|
||||
return commit(true);
|
||||
|
@ -241,10 +241,8 @@ public class EditorWindowDelegate extends WindowDelegate {
|
||||
public boolean isModified() {
|
||||
if (readOnly)
|
||||
return false;
|
||||
else if (wrapper instanceof Window.Committable)
|
||||
return ((Window.Committable) wrapper).isModified();
|
||||
else
|
||||
return window.getDsContext() != null && window.getDsContext().isModified();
|
||||
return super.isModified();
|
||||
}
|
||||
|
||||
public boolean commit(boolean close) {
|
||||
|
@ -213,6 +213,13 @@ public class WindowDelegate {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isModified() {
|
||||
if (wrapper instanceof Window.Committable)
|
||||
return ((Window.Committable) wrapper).isModified();
|
||||
else
|
||||
return window.getDsContext() != null && window.getDsContext().isModified();
|
||||
}
|
||||
|
||||
public Window openWindow(String windowAlias, WindowManager.OpenType openType, Map<String, Object> params) {
|
||||
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
|
||||
return window.getWindowManager().openWindow(windowInfo, openType, params);
|
||||
|
@ -1121,8 +1121,8 @@ public class WebWindow implements Window, Component.Wrapper,
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean isModified() {
|
||||
return getDsContext() != null && getDsContext().isModified();
|
||||
public boolean isModified() {
|
||||
return delegate.isModified();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1416,11 +1416,6 @@ public class WebWindow implements Window, Component.Wrapper,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return ((EditorWindowDelegate) delegate).isModified();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean commit() {
|
||||
return commit(true);
|
||||
|
Loading…
Reference in New Issue
Block a user