on ‎2018 Jul 09 12:24 PM
There is a remove interceptor in which we are throwing a validator exception like below snippet
throw new MyValidatorException(l10nService.getLocalizedString("exception.itemtype.cannot.remove.online", new Object[] {}));
Property value in localization fiel is : exception.itemtype.cannot.remove.online = can not remove this item type as it has associated online version available.
MyValidatorException class implementation is like below:
public class MyValidatorException extends InterceptorException { public MyValidatorException(final String message) { super(message); this.setCustomErrorMessage(message); } }
This is the implementation and am getting below exception message in backoffice UI while deleting itemtype is like below:
I want below message to be displayed in Backoffie UI as above localized property value

Request clarification before answering.
Default backoffice notification-area message for remove object failure configurated like:
<na:notifications eventType="RemoveObject" level="FAILURE">
<na:message>user.notification.items.unable_to_delete</na:message>
<!-- Expected map in form object -> exception -->
<na:references linksEnabled="true">
<na:reference placeholder="0"
label="#root.size() == 1 ? (@labelService.getObjectLabel(#root.keySet().iterator().next()) + ' ' + @exceptionTranslationService.toString(#root.values().iterator().next())) : #root.size()"
message="#root.keySet().iterator().next()" link="#root.size() == 1" />
</na:references>
</na:notifications>
In short, your exception message will be mapped to the label user.notification.items.unable_to_delete
Hence the only way to show the custom message is to redeclare the configuration for your needs.
PS:
label user.notification.items.unable_to_delete declared in
/hybris/bin/ext-backoffice/backoffice/web/webroot/WEB-INF/lib/backoffice-widgets-6.7.0.0-RC8.jar!/backoffice/labels/labels_en.properties
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.