(Quick Reference)
displayMessage
Call this method in controllers to set the display message for the current request.
The view can render this message using the
displayMessage tag.
There are two forms of the method:
displayMessage(String msg)
- set the message string (or message code)
displayMessage(Map args)
- set the message arguments (or message code)
When plugins call this method, their "text" value is automatically namespaced with "plugin.<pluginName>." so this effectively
forces all usage in plugins to use i18n messages for text - which is a good thing, because it means the application can override the UI text.
If using the Map arguments form, the
args
supported are:
Name | Purpose |
---|
text | The text of the label, or an i18n code to resolve to use as the text |
textArgs | Optional arguments to pass when creating the i18n message text |
type | Optional message type indicator i.e. 'warning', 'error', 'info', 'debug' |
class | Optional CSS class to apply |
cssPrefix | Optional prefix to apply if "type" is supplied, prepended to the type name |
This method stores the message information in the current request scope.