Hi everyone,
today we ran into the following situation: We wanted to disable-on-click a button and used the jmix build-in way for doing this:
<button id="commitAndCloseBtn" action="windowCommitAndClose" disableOnClick="true"/>
Then we have two cases:
- The operations on commit run successfully and the window is closed => This is fine
- One of the validations fail before committing the operation and we need to re-renable the button, so the user is able to change the entered data and commit again
For the second point we only found the way to override the method closeWithCommit
in the following way:
@Override
public OperationResult closeWithCommit() {
commitAndCloseBtn.setEnabled(true);
return super.closeWithCommit();
}
In the team we agreed, that the nicer way to do this re-enabling of the button would be to have an event handler which allows us to do something in case the validation fails either in StandardEditor.validateUiComponents
or in StandardEditor.validateAdditionalRules()
.
Is there any event handler we missed here and which could be used to achieve what we need? Or could this be a possible improvement for a future jmix version?
Thank you for some ideas or discussions!
Best regards,
Thomas