wwModalDialog.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)

Parameters

Id
The ID of the main dialog created.

Width
The width of the dialog.

OkCaption
The text for the OK button.

CancelCaption
Optional caption for the Cancel button. If not specified the Cancel button is not displayed

DialogHandler
An optional client function handler that receives two parameters: 0 or 1 for cancel/ok and a reference to the button object that was clicked.

Example

<script> function MessageBox(Message,Title) { // *** Create here inline or make this ref global var Mbox = wwModalDialog.createDialog("Mbox",500,"Done","Cancel",MBox_Callback); Mbox.showDialog(Message.htmlEncode(),Title.htmlEncode()); } function MBox_Callback(Result,Button) { if (Result == 1) alert("Ok. Button Text: " + Button.value); else alert("Cancel. Button Text: " + Button.value); } </script>
// *** then from anywhere in the application: MessageBox("Hello World","Application Message");

See also:

Class wwModalDialog


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