Hey,
How can I change the message duration of the default validation?
I’ve used the code snippet below which works but I want this be applied globally:
@Subscribe
public void onInit(final InitEvent event) {
setShowValidationErrors(false);
}
@Autowired
private Notifications notifications;
@Autowired
private Messages messages;
@Install(to = "saveAction", subject = "failHandler")
private void saveActionFailHandler() {
ViewValidation viewValidation = getApplicationContext().getBean(ViewValidation.class);
ValidationErrors validationErrors = viewValidation.validateUiComponents(getContent());
String message = ViewValidation.getValidationErrorsMessage(validationErrors);
notifications.create(messages.getMessage("validationFail.title"), message)
.withPosition(Notification.Position.MIDDLE)
.withDuration(3000)
.show();
}
N.B: Jmix version 2.2.1
Regards,
Tahsin.