I think you have to use the FeedbackHelper class:
https://apidocs.rnd.mendix.com/9/runtime/com/mendix/webui/FeedbackHelper.html
FeedbackHelper.addTextMessageFeedback(getContext(), IFeedback.MessageType.INFO, "My custom message", true);
Hope this helps!