Send a message to a client in Java code

Is it possible to send a message to the client using Java code?
1 answers

Yes, this is possible.

Assuming you are adding code to a custom Java action, import a relevant package.

import com.mendix.systemwideinterfaces.core.IFeedback.MessageType;

and in the User Code section of executeAction, add your feedback as follows,

this.addTextMessageFeedback(MessageType.INFO, "Message to send", false);

Where the first argument is an enumeration (INFO, WARN, ERROR), the second argument is the message to send and the third argument determines whether or not this message is 'blocking' (that is, appears in a modal dialog).