Web Dynpro – Message Handling
In the ABAP program, we can use ABAP statement to show the error, warning or information message to the user. In Web dynpro for Java, It is also very convenience to handle the message.
Step 1. Add the message in the message pool under your component.
There are for message types: standard, warning, error, text. If you want to add the parameter in the message text, you should put parameter holder like {0},{1}. After add the message to the message pool. The NWDS will automatic generate a java class like ‘IMessage<component name>’.
Step2. After add message, you can report the message using below Java code in the method.
IWDMessageManager manager = wdComponentAPI.getMessageManager(); //if some condition meets if(...){ manager.reportMessage(IMessageProj_eval.MISS_PARAMETER, new Object[]{"Project Id"}, true); return false; }
You can also create corresponding properties files for other language. The web dynpro will automatic choose the language according to the language setting in your browser.