Message is no longer supported. Use Flag instead.
Messages are the primary method for providing system feedback in the product user interface. Messages include notifications of various kinds: alerts, confirmations, notices, warnings, info and errors.
For visual examples of each kind please see the Design guide.
1 2 3 4 5AP.require("messages", function(messages){ //create a message var message = messages.info('plain text title', 'plain text body'); });
Name | Type | Description |
---|---|---|
closeable | Boolean | Adds a control allowing the user to close the message, removing it from the page |
fadeout | Boolean | Toggles the fade away on the message |
delay | Number | Time to wait (in ms) before starting fadeout animation (ignored if fadeout==false) |
duration | Number | Fadeout animation duration in milliseconds (ignored if fadeout==false) |
Clear a message.
Name | Type | Description |
---|---|---|
id | String | The ID that was returned when the message was created |
1 2AP.require("messages", function(messages){ //create a message var message = messages.info('title', 'body'); setTimeout(function(){ messages.clear(message); }, 2000); });
Show an error message.
Name | Type | Description |
---|---|---|
title | String | Sets the title text of the message |
body | String | The main content of the message |
options | MessageOptions | Message Options |
Returns: the ID to be used when clearing the message; String.
1 2AP.require("messages", function(messages){ //create a message var message = messages.error('title', 'error message example'); });
Show a generic message.
Name | Type | Description |
---|---|---|
title | String | Sets the title text of the message |
body | String | The main content of the message |
options | MessageOptions | Message Options |
Returns: the ID to be used when clearing the message; String.
1 2AP.require("messages", function(messages){ //create a message var message = messages.generic('title', 'generic message example'); });
Show a hint message.
Name | Type | Description |
---|---|---|
title | String | Sets the title text of the message |
body | String | The main content of the message |
options | MessageOptions | Message Options |
Returns: the ID to be used when clearing the message; String.
1 2AP.require("messages", function(messages){ //create a message var message = messages.hint('title', 'hint message example'); });
Show an info message.
Name | Type | Description |
---|---|---|
title | String | Sets the title text of the message |
body | String | The main content of the message |
options | MessageOptions | Message Options |
Returns: the ID to be used when clearing the message; String.
1 2AP.require("messages", function(messages){ //create a message var message = messages.info('title', 'info message example'); });
Show a success message.
Name | Type | Description |
---|---|---|
title | String | Sets the title text of the message |
body | String | The main content of the message |
options | MessageOptions | Message Options |
Returns: the ID to be used when clearing the message; String.
1 2AP.require("messages", function(messages){ //create a message var message = messages.success('title', 'success message example'); });
Show a warning message.
Name | Type | Description |
---|---|---|
title | String | Sets the title text of the message |
body | String | The main content of the message |
options | MessageOptions | Message Options |
Returns: the ID to be used when clearing the message; String.
1 2AP.require("messages", function(messages){ //create a message var message = messages.warning('title', 'warning message example'); });
Rate this page: