Client Class wwModalDialog

This class allows creating a modal dialog that hides the background of the Web page using an opaque overlay and then pops an HTML element of your choice on top of it. The element (typically a Div tag) should also contain a button or hyper link used to close the dialog.

The control works by being assigned an HTML DOM element Id that acts as the dialog, plus at least one 'button' object that can be clicked to close the dialog. You can use two different buttons (okButtonId/cancelButtonId) and route the clicks to an event handler of your choice.

More info on operation can be found here.

Class Members

MemberDescription
Constructor The constructor configures this object and sets a number of common properties.
createDialog This static method creates a generic dialog so that you don't have to create any elements in your document manually.
o.wwModalDialog.createDialog(Id,Width,OkCaption,CancelCaption,DialogHandler)
hideDialog Hides the dialog and overlay.
o.wwModalDialog.hideDialog()
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.
static wwModalDialog.messageBox(Message,Title,OkButton,CancelButton,MBoxHandler)
showDialog Displays the dialog and overlay. Content is displayed in the element specified by contentId of the class the title in headerId. If these elements are not available content is written into the top level control.
static wwModalDialog.showDialog(Message,Title)
backgroundOpacity The opacity used on the background overlay.
boxObj wwControl instance of the outer dialog box. Provided so you can possibly customize the display via script code.
cancelButtonId Optiona Id of a cancel button. If not provided there's no hook for cancel operations. If provided you should also provide a cancelHandler function that is called when the cancel button is pressed.
dialogHandler Optional handler function pointer that is called when you click on the Ok or Cancel button. A single parameter is passed: 1-Ok, 0-Cancel
dialogID The Id of the main Dialog.
okButtonId A client ID that identifies the main button that is used to close the dialog. Optionally you can receive an event in the okHandler when the button is pressed.
overlayID Optional ID of an element that is used as a background overlay. If this Id is not provided a default element is created. Use this option if you want to customize the display of the overlay by setting background colors, images or any content you want to display as part of the background.
ovObj wwControl instance of the overlay control used to provide the opaque background. Provided so you can customize display of the control after creating a dialog.
zIndex The zIndex used to prop the overlay and dialog to the top of the zOrder. Defaults to 10,000, but is provided here in case you need to set a specific value to force to the top.

Requirements

See also:

Class wwModalDialog

  Last Updated: 9/8/2007 | © West Wind Technologies, 2008