Detect in postInit if window was just opened or saved

Hi CUBA community,

I’m looking for a possibility to detect in postInit() if the window (editor) was just opened or the postInit method was called after I used the save (commit) action, which keeps the window open but triggers the postInit again after save.
Additional handicap is that the detection should be in the super.postInit() not in the controller directly.

Any help would be appreciated.

Thanks
Steven

Hi Steven,

What about using a boolean flag like this:

private boolean firstTime = true;

protected void postInit() {
    if (firstTime) {
        // ...
        firstTime = false;
    }
}