Interface
caplin.services

UserPromptService

By implementing the UserPromptService interface, clients can implement their own strategy for how they deal with messages that need to be displayed to the user. The standard implementation of UserPromptService ({@link caplin.services.StandardUserPromptService StandardUserPromptService}), merely displays the alerts within a simple DHTML dialog box.

Constructor Summary

Attributes Name and Description
caplin.services.UserPromptService()

Method Summary

Attributes Name and Description
void alert(String sMessage, Map oParams)

Displays an alert dialog box to the user.

void confirm(String sMessage, Map oParams)

Displays a confirmation dialog box to the user.

void isAlertShowing()

Used to query if an alert or confirm alert dialog is currently displayed.

void optionalAlert(String sMessage, Map oParams)

Displays an alert dialog box to the user, with an option to never see the alert again.

void optionalConfirm(String sMessage, Map oParams)

Displays a confirmation dialog box to the user, with an option to never see the confirmation again.

Constructor Detail

caplin.services.UserPromptService()

Method Detail

void alert(String sMessage, Map oParams)

Displays an alert dialog box to the user.

Since this is a non-blocking method, the fCallBack parameter should be used to provide any code that must be executed once the dialog has been closed.

The fCallBack function will always be passed true as its first parameter. The previous api (message,callback,caption) should still be supported by UserPromptServices.

Parameters
String sMessage The alert message template to be displayed to the user.
Map oParams Parameters that affect the alert and can be referenced by the message.
Function oParams.callback (Optional) A call back function that will be executed once the user has closed the dialog.
String oParams.caption (Optional) The text displayed as a dialog caption. Default is 'Alert' or equivalent as per alert dispatcher.
String oParams.code (Optional) The code used to identify the type of alert. This will be used to translate/customise the message.
String oParams.ok (Optional) The text on the ok button.
String oParams.detail (Optional) Further details about the issue.

void confirm(String sMessage, Map oParams)

Displays a confirmation dialog box to the user.

Since this is a non-blocking method, the fCallBack parameter should be used to provide any code that must be executed once the dialog has been closed. The fCallBack function will be passed true as its first parameter if the user clicks the 'Ok' button, and false otherwise.

The previous api (message,callback,ok,cancel,caption) should still be supported by UserPromptServices.

Parameters
String sMessage The alert message template to be displayed to the user.
Map oParams Parameters that affect the alert and can be referenced by the message.
Function oParams.callback (Optional) A call back function that will be executed once the user has closed the dialog.
String oParams.caption (Optional) The text displayed as a dialog caption. Default is 'Alert' or equivalent as per alert dispatcher.
String oParams.code (Optional) The code used to identify the type of alert. This will be used to translate/customise the message.
String oParams.ok (Optional) The text on the ok button.
String oParams.cancel (Optional) The text on the cancel button.
String oParams.detail (Optional) Further details about the issue.

void isAlertShowing()

Used to query if an alert or confirm alert dialog is currently displayed.

Will return true if an alert/confirm alert is currently displayed else false. Does not cover confirm dialogs only alerts.

void optionalAlert(String sMessage, Map oParams)

Displays an alert dialog box to the user, with an option to never see the alert again.

Since this is a non-blocking method, the fCallBack parameter should be used to provide any code that must be executed once the dialog has been closed.

The fCallBack function will always be passed true as its first parameter. The previous api (message,code,callback,caption) should still be supported by UserPromptServices.

Parameters
String sMessage The alert message template to be displayed to the user.
Map oParams Parameters that affect the alert and can be referenced by the message.
Function oParams.callback (Optional) A call back function that will be executed once the user has closed the dialog.
String oParams.caption (Optional) The text displayed as a dialog caption. Default is 'Alert' or equivalent as per alert dispatcher.
String oParams.code (Optional) The code used to identify the type of alert. This will be used to translate/customise the message.
String oParams.ok (Optional) The text on the ok button.
String oParams.detail (Optional) Further details about the issue.

void optionalConfirm(String sMessage, Map oParams)

Displays a confirmation dialog box to the user, with an option to never see the confirmation again.

Since this is a non-blocking method, the fCallBack parameter should be used to provide any code that must be executed once the dialog has been closed. The fCallBack function will be passed true as its first parameter if the user clicks the 'Ok' button, and false otherwise.

The previous api (message,code,callback,ok,cancel,caption) should still be supported by UserPromptServices.

Parameters
String sMessage The alert message template to be displayed to the user.
Map oParams Parameters that affect the alert and can be referenced by the message.
Function oParams.callback (Optional) A call back function that will be executed once the user has closed the dialog.
String oParams.caption (Optional) The text displayed as a dialog caption. Default is 'Alert' or equivalent as per alert dispatcher.
String oParams.code (Optional) The code used to identify the type of alert. This will be used to translate/customise the message.
String oParams.ok (Optional) The text on the ok button.
String oParams.cancel (Optional) The text on the cancel button.
String oParams.detail (Optional) Further details about the issue.