Java pop-up messages

2
How can I send a pop-up message -warn, -error etc (other than logging a message into the console) directly from Java into a running mendix-project?
asked
2 answers
3

Easiest way would probably be to execute a Microflow that handles the feedback.

    // BEGIN USER CODE
    Map<String, Object> params = Maps.newHashMap();
    params.put("message", "hello person!");
    Core.execute(getContext(), "MyModule.MyMicroflow", params);
    return true;
    // END USER CODE

(this assumes you have a microflow "MyMicroflow" in module "MyModule" that takes a single string as parameter with name "message")

answered
3

It is even more simple than that: just use:

public Boolean executeAction() throws Exception
{
    // BEGIN USER CODE
    this.addTextMessageFeedback(MessageType.ERROR, "hoi", true);
    return true;
}
answered