How do I check in 7.x if the user closed the editor or not?:
@Subscribe(target = Target.DATA_CONTEXT)
private void onPostCommit(DataContext.PostCommitEvent event) {
//Only do this if the window is not closed..?
}
I want to reload the screen data, because some processing is done in the middleware after saving and it’s not reflecting all the changes automatically to the user.
Using the Instanceloader.load() fixes that, but it doesn’t make sense to call it if the window is closed.
You can just override the commit() method of StandardEditor:
@Override
protected void commit(Action.ActionPerformedEvent event) {
super.commit(event);
// your logic here
// called only when committed without closing
}
@Override
protected void commit(Action.ActionPerformedEvent event) {
// commit changes may return fail() if validation failed
commitChanges()
.then({
// your logic here
// called only when committed successfully without closing
});
}