wwModalDialog.messageBox

One line static method that can be used to show a message box generically. There's not much control over how this control is displayed, but it's easy to use in any page that includes the client script library.

This method can be directly accessed from anywhere with code like this:

wwModalDialog.MessageBox("your message","your title","Yes","No",MBoxHandler); function MBoxHandler(Result,buttonElement) { if (Result == 1) alert("Yes"); else alert("No"); }

Note if you use this function a generic dialog is created and you have no control over the formatting other than the actual message. If you need to format the dialog you'll need to use the instance class and hook up the appropriate dialogId,contentID and headerId properties.

The function returns an instance of the wwModalDialog class, so you can potentially further format it by accessing the boxObj and ovObj properties of the instance.

static wwModalDialog.messageBox(Message,Title,OkButton,CancelButton,MBoxHandler)

Return Value

Instance of the wwModalDialog client class

Parameters

Message
The message to display. The value is considered to be HTML. If you want to provide safe text use Text.htmlEncode() of the library.

Title
The title to display. This value is provided as text always (no html formatting can be provided).

OkButton
The caption for the Ok button

CancelButton
The caption for the second/cancel button. If not provided the button is not shown.

MBoXHandler
Optional client script handler called when a button is clicked. 0 for cancel, 1 for ok. The handler also receives an instance of the button element so you can retrieve the button caption (Button.value)

See also:

Class wwModalDialog


  Last Updated: 1/30/2007 | © West Wind Technologies, 2008