box.system.plugins.concurrent.Callable interface">
ColdBox Platform Version 3.1.0
Callable

coldbox.system.plugins
Class MessageBox

WEB-INF.cftags.component
        extended by coldbox.system.FrameworkSupertype
            extended by coldbox.system.Plugin
                extended by coldbox.system.plugins.MessageBox

public class MessageBox
extends Plugin

This is the MessageBox plugin. It uses the session/client scope to save messages.


Constructor Summary
init(any controller)
          Constructor
 
Method Summary
 void append(string message)
          Append a message to the MessageBox
 void appendArray(Array messageArray)
          Append an array of messages to the MessageBox
 void clearMessage()
          Clears the message structure by deleting it from the session scope
 void error([string message=''], [Array messageArray])
          Facade to setmessage with error type
private any flattenMessageArray(Array messageArray)
 any getMessage()
          Returns a structure of the message if it exists, else a blank structure
 void info([string message=''], [Array messageArray])
          Facade to setmessage with info type
 boolean isEmpty()
          Checks wether the MessageBox is empty or not
 any renderMessage(string type, [string message=''], [Array messageArray])
          Renders a messagebox immediately for you with the passed in arguments
 any renderit([boolean clearMessage='true'])
          Renders the message box and clears the message structure by default
 void setMessage(string type, [string message=''], [Array messageArray])
          Create a new MessageBox
 void warn([string message=''], [Array messageArray])
          Facade to setmessage with warning type
 
Methods inherited from class coldbox.system.Plugin
getPluginDescription, getPluginName, getPluginVersion, getRequestCollection, getRequestContext, getpluginAuthor, getpluginAuthorURL, getpluginPath, setPluginDescription, setPluginName, setPluginVersion, setpluginAuthor, setpluginAuthorURL
 
Methods inherited from class coldbox.system.FrameworkSupertype
$abort, $dump, $htmlhead, $include, $rethrow, $throw, addAsset, announceInterception, getColdboxOCM, getController, getDatasource, getDebugMode, getInterceptor, getMailService, getMailSettings, getMemento, getModel, getModuleSettings, getMyPlugin, getNewMail, getPlugin, getResource, getSetting, getSettingStructure, getSettingsBean, getfwLocale, includeUDF, locateDirectoryPath, locateFilePath, persistVariables, populateModel, relocate, renderExternalView, renderLayout, renderView, runEvent, setDebugMode, setNextEvent, setNextRoute, setSetting, setfwLocale, settingExists
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(any controller)
Constructor

Parameters:
controller - coldbox.system.web.Controller
Method Detail

append

public void append(string message)
Append a message to the MessageBox. If there is no message, then it sets the type to information.

Parameters:
message - The message to append, it does not include any breaks or delimiters. You must send that.

appendArray

public void appendArray(Array messageArray)
Append an array of messages to the MessageBox. If there is no message, then it sets the type to information.

Parameters:
messageArray - The array of messages to append. You must send that.

clearMessage

public void clearMessage()
Clears the message structure by deleting it from the session scope.


error

public void error([string message=''], [Array messageArray])
Facade to setmessage with error type

Parameters:
message - The message to show.
messageArray - You can also send in an array of messages to render separated by a

flattenMessageArray

private any flattenMessageArray(Array messageArray)

Parameters:
messageArray - Array of messages to flatten

getMessage

public any getMessage()
Returns a structure of the message if it exists, else a blank structure.


info

public void info([string message=''], [Array messageArray])
Facade to setmessage with info type

Parameters:
message - The message to show.
messageArray - You can also send in an array of messages to render separated by a

isEmpty

public boolean isEmpty()
Checks wether the MessageBox is empty or not.


renderMessage

public any renderMessage(string type, [string message=''], [Array messageArray])
Renders a messagebox immediately for you with the passed in arguments

Parameters:
type - The message type.Available types [error][warning][info]
message - The message to show.
messageArray - You can also send in an array of messages to render separated by a

renderit

public any renderit([boolean clearMessage='true'])
Renders the message box and clears the message structure by default.

Parameters:
clearMessage - Flag to clear the message structure or not after rendering. Default is true.

setMessage

public void setMessage(string type, [string message=''], [Array messageArray])
Create a new MessageBox. Look at types.

Parameters:
type - The message type.Available types [error][warning][info]
message - The message to show.
messageArray - You can also send in an array of messages to render separated by a

warn

public void warn([string message=''], [Array messageArray])
Facade to setmessage with warning type

Parameters:
message - The message to show.
messageArray - You can also send in an array of messages to render separated by a

ColdBox Platform Version 3.1.0