Documentation

messages

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.

Example

AP.require("messages", function(messages){
  //create a message
  var message = messages.info('plain text title', 'plain text body');
});

Methods

clear(id)

clear a message

Parameters:
Name Type Description
id String

The id that was returned when the message was created.

Example
AP.require("messages", function(messages){
  //create a message
  var message = messages.info('title', 'body');
  messages.clear(message);
});

error(title, body, options) → {String}

Show an error message

Parameters:
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

generic(title, body, options) → {String}

Show a generic message

Parameters:
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

hint(title, body, options) → {String}

Show a hint message

Parameters:
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

info(title, body, options) → {String}

Show an info message

Parameters:
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

success(title, body, options) → {String}

Show a success message

Parameters:
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

warning(title, body, options) → {String}

Show a warning message

Parameters:
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