Print Friendly

# Class YAHOO.widget.Dialog

Package: | YAHOO.widget
Class: | Dialog
Extends: | Panel
Subclasses: | SimpleDialog
Defined In: | container.js

Dialog is an implementation of Panel that can be used to submit form data. Built-in functionality for buttons with event handlers is included, and button sets can be build dynamically, or the preincluded ones for Submit/Cancel and OK/Cancel can be utilized. Forms can be processed in 3 ways -- via an asynchronous Connection utility call, a simple form POST or GET, or manually.

## Public Properties

Property | Defined By
--- | ---
| BOTTOM_LEFT<static> : String | Overlay
<static> Constant representing the top bottom left corner of an element, used for configuring the context eleme...
| BOTTOM_RIGHT<static> : String | Overlay
<static> Constant representing the bottom right corner of an element, used for configuring the context element ...
| CSS_DIALOG<static> : String | Dialog
<static> Constant representing the default CSS class used for a Dialog
| CSS_OVERLAY<static> : String | Overlay
<static> Constant representing the default CSS class used for an Overlay
| CSS_PANEL<static> : String | Panel
<static> Constant representing the default CSS class used for a Panel
| CSS_PANEL_CONTAINER<static> : String | Panel
<static> Constant representing the default CSS class used for a Panel's wrapping container
| TOP_LEFT<static> : String | Overlay
<static> Constant representing the top left corner of an element, used for configuring the context element alig...
| TOP_RIGHT<static> : String | Overlay
<static> Constant representing the top right corner of an element, used for configuring the context element ali...
| argument : Object | Dialog
The arbitraty argument or arguments to pass to the Connection callback functions
| callback : Object | Dialog
The internally maintained callback object for use with the Connection utility
| cfg : Object[] @default | Dialog
Object literal(s) defining the buttons for the Dialog's footer. @config buttons
| failure : Function | Dialog
The function to execute upon failure of the Connection submission
| javascript : String | Overlay
<static> The URL that will be placed in the iframe
| success : Function | Dialog
The function to execute upon success of the Connection submission

## Public Methods

Method | Defined By
--- | ---
| Dialog(`String el`, `HTMLElement el`, `Object userConfig`) | Dialog
| align(`String elementAlign`, `String contextAlign`) : void | Overlay
Aligns the Overlay to its context element using the specified corner points (represented by the constants TOP_LEFT, T...
| blurButtons() : void | Dialog
Blurs all the html buttons
| buildMask() : void | Panel
Builds the mask that is laid over the document when the Panel is configured to be modal.
| buildWrapper() : void | Panel
Builds the wrapping container around the Panel that is used for positioning the shadow and matte underlays. The conta...
| cancel() : void | Dialog
Executes the cancel of the Dialog followed by a hide.
| center() : void | Overlay
Centers the container in the viewport.
| cfg() : void | Dialog
The method to use for posting the Dialog's form. Possible values are "async", "form", and "manual". @config postmethod
| configButtons(`String type`, `Object[] args`, `Object obj`) : void | Dialog
The default event handler for the "buttons" configuration property
| configClose(`String type`, `Object[] args`, `Object obj`) : void | Panel
The default event handler fired when the "close" property is changed. The method controls the appending or hiding of ...
| configConstrainToViewport(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler fired when the "constraintoviewport" property is changed.
| configContext(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler fired when the "context" property is changed.
| configDraggable(`String type`, `Object[] args`, `Object obj`) : void | Panel
The default event handler fired when the "draggable" property is changed.
| configFixedCenter(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler fired when the "fixedcenter" property is changed.
| configHeight(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler fired when the "height" property is changed.
| configIframe(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler fired when the "iframe" property is changed.
| configKeyListeners(`String type`, `Object[] args`, `Object obj`) : void | Panel
The default event handler fired when the "keylisteners" property is changed.
| configModal(`String type`, `Object[] args`, `Object obj`) : void | Panel
The default event handler fired when the "modal" property is changed. This handler subscribes or unsubscribes to the ...
| configUnderlay(`String type`, `Object[] args`, `Object obj`) : void | Panel
The default event handler fired when the "underlay" property is changed.
| configVisible(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler fired when the "visible" property is changed. This method is responsible for firing showEve...
| configWidth(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler fired when the "width" property is changed.
| configX(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler fired when the "x" property is changed.
| configXY(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler fired when the "xy" property is changed.
| configY(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler fired when the "y" property is changed.
| configzIndex(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler fired when the "zIndex" property is changed.
| destroy() : void | Overlay
Removes the Overlay element from the DOM and sets all child elements to null.
| doCenterOnDOMEvent() : void | Overlay
Center event handler used for centering on scroll/resize, but only if the Overlay is visible
| doSubmit() : void | Dialog
Performs the submission of the Dialog form depending on the value of "postmethod" property.
| enforceConstraints(`String type`, `Object[] args`, `Object obj`) : void | Overlay
The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true.
| focusDefaultButton() : void | Dialog
Sets the focus to the button that is designated as the default. By default, his handler is executed when the show eve...
| focusFirst() : void | Dialog
The default event handler used to focus the first field of the form when the Dialog is shown.
| focusFirstButton() : void | Dialog
Sets the focus to the first button in the button list
| focusLast() : void | Dialog
Sets the focus to the last button in the button or form element in the Dialog
| focusLastButton() : void | Dialog
Sets the focus to the first button in the button list
| getData() : Object | Dialog
Returns a JSON-compatible data structure representing the data currently contained in the form.
| hideIframe() : void | Overlay
Hides the iframe shim, if it has been enabled
| hideMacGeckoScrollbars() : void | Overlay
Adds a special CSS class to the Overlay when Mac/Gecko is in use, to work around a Gecko bug where scrollbars cannot ...
| hideMask() : void | Panel
Hides the modality mask.
| init(`String el`, `HTMLElement el`, `Object userConfig`) : void | Dialog
The Dialog initialization method, which is executed for Dialog and all of its subclasses. This method is automaticall...
| initDefaultConfig() : void | Dialog
Initializes the class's configurable properties which can be changed using the Dialog's Config object (cfg).
| initEvents() : void | Dialog
Initializes the custom events for Dialog which are fired automatically at appropriate times by the Dialog class.
| moveTo(`Number x`, `Number y`) : void | Overlay
Moves the Overlay to the specified position. This function is identical to calling this.cfg.setProperty("xy", [x,y]);
| onDomResize(`DOMEvent e`, `Object obj`) : void | Overlay
Event handler fired when the resize monitor element is resized.
| registerDragDrop() : void | Panel
Registers the Panel's header for drag & drop capability.
| registerForm() : void | Dialog
Prepares the Dialog's internal FORM object, creating one if one is not currently present.
| removeMask() : void | Panel
Removes the modality mask.
| render(`String appendToNode`, `HTMLElement appendToNode`) : boolean | Panel
Renders the Panel by inserting the elements that are not already in the main Panel into their correct places. Optiona...
| showIframe() : void | Overlay
Shows the iframe shim, if it has been enabled
| showMacGeckoScrollbars() : void | Overlay
Removes a special CSS class from the Overlay when Mac/Gecko is in use, to work around a Gecko bug where scrollbars ca...
| showMask() : void | Panel
Shows the modality mask.
| sizeMask() : void | Panel
Sets the size of the modality mask to cover the entire scrollable area of the document
| sizeUnderlay() : void | Panel
Adjusts the size of the shadow based on the size of the element.
| submit() : void | Dialog
Executes a submit of the Dialog followed by a hide, if validation is successful.
| syncPosition() : void | Overlay
Synchronizes the Panel's "xy", "x", and "y" properties with the Panel's position in the DOM. This is primarily used t...
| toString() : String | Dialog
Returns a string representation of the object.
| validate() : void | Dialog
Built-in function hook for writing a validation function that will be checked for a "true" value prior to a submit. T...
| windowResizeHandler<static>(`DOMEvent e`) : void | Overlay
<static> The DOM event handler used to fire the CustomEvent for window resize
| windowScrollHandler<static>(`DOMEvent e`) : void | Overlay
<static> The DOM event handler used to fire the CustomEvent for window scroll

## Public Events

Event | Defined By
--- | ---
| YAHOO.widget.Overlay.windowResizeEvent : () | Overlay
A singleton CustomEvent used for reacting to the DOM event for window resize
| YAHOO.widget.Overlay.windowScrollEvent : () | Overlay
A singleton CustomEvent used for reacting to the DOM event for window scroll
| asyncSubmitEvent : () | Dialog
CustomEvent fired prior to asynchronous submission
| beforeMoveEvent : (`Number x`, `Number y`) | Overlay
CustomEvent fired before the Overlay is moved.
| beforeSumitEvent : () | Dialog
CustomEvent fired prior to submission
| cancelEvent : () | Dialog
CustomEvent fired after cancel
| dragEvent : () | Panel
CustomEvent when the Panel is dragged
| formSubmitEvent : () | Dialog
CustomEvent fired prior to form-based submission
| hideMaskEvent : () | Panel
CustomEvent fired after the modality mask is hidden
| manualSubmitEvent : () | Dialog
CustomEvent fired prior to manual submission
| moveEvent : (`Number x`, `Number y`) | Overlay
CustomEvent fired after the Overlay is moved.
| showMaskEvent : () | Panel
CustomEvent fired after the modality mask is shown
| submitEvent : () | Dialog
CustomEvent fired after submission

## Property Details

### BOTTOM_LEFT<static>

`public String BOTTOM_LEFT<static>`
<static> Constant representing the top bottom left corner of an element, used for configuring the context element alignment
This property is defined by Overlay.

### BOTTOM_RIGHT<static>

`public String BOTTOM_RIGHT<static>`
<static> Constant representing the bottom right corner of an element, used for configuring the context element alignment
This property is defined by Overlay.

### CSS_DIALOG<static>

`public String CSS_DIALOG<static>`
<static> Constant representing the default CSS class used for a Dialog
This property is defined by Dialog.

### CSS_OVERLAY<static>

`public String CSS_OVERLAY<static>`
<static> Constant representing the default CSS class used for an Overlay
This property is defined by Overlay.

### CSS_PANEL<static>

`public String CSS_PANEL<static>`
<static> Constant representing the default CSS class used for a Panel
This property is defined by Panel.

### CSS_PANEL_CONTAINER<static>

`public String CSS_PANEL_CONTAINER<static>`
<static> Constant representing the default CSS class used for a Panel's wrapping container
This property is defined by Panel.

### TOP_LEFT<static>

`public String TOP_LEFT<static>`
<static> Constant representing the top left corner of an element, used for configuring the context element alignment
This property is defined by Overlay.

### TOP_RIGHT<static>

`public String TOP_RIGHT<static>`
<static> Constant representing the top right corner of an element, used for configuring the context element alignment
This property is defined by Overlay.

### argument

`public Object argument`
The arbitraty argument or arguments to pass to the Connection callback functions
This property is defined by Dialog.

### callback

`public Object callback`
The internally maintained callback object for use with the Connection utility
This property is defined by Dialog.

### cfg

`public Object[] @default cfg`
Object literal(s) defining the buttons for the Dialog's footer. @config buttons
This property is defined by Dialog.

### failure

`public Function failure`
The function to execute upon failure of the Connection submission
This property is defined by Dialog.

### javascript

`public String javascript`
<static> The URL that will be placed in the iframe
This property is defined by Overlay.

### success

`public Function success`
The function to execute upon success of the Connection submission
This property is defined by Dialog.

## Constructor Details

### Dialog

`public function Dialog(`String el`, `HTMLElement el`, `Object userConfig`)`
Parameters:

- `el` : String
  The element ID representing the Dialog OR
- `el` : HTMLElement
  The element representing the Dialog
- `userConfig` : Object
  The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.

## Method Details

### align

`public function align(`String elementAlign`, `String contextAlign`)`
Aligns the Overlay to its context element using the specified corner points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, and BOTTOM_RIGHT.
Parameters:

- `elementAlign` : String
  The String representing the corner of the Overlay that should be aligned to the context element
- `contextAlign` : String
  The corner of the context element that the elementAlign corner should stick to.

Returns:

- `void`

This method is defined by Overlay.

### blurButtons

`public function blurButtons()`
Blurs all the html buttons
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### buildMask

`public function buildMask()`
Builds the mask that is laid over the document when the Panel is configured to be modal.
Parameters:

- None.

Returns:

- `void`

This method is defined by Panel.

### buildWrapper

`public function buildWrapper()`
Builds the wrapping container around the Panel that is used for positioning the shadow and matte underlays. The container element is assigned to a local instance variable called container, and the element is reinserted inside of it.
Parameters:

- None.

Returns:

- `void`

This method is defined by Panel.

### cancel

`public function cancel()`
Executes the cancel of the Dialog followed by a hide.
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### center

`public function center()`
Centers the container in the viewport.
Parameters:

- None.

Returns:

- `void`

This method is defined by Overlay.

### cfg

`public function cfg()`
The method to use for posting the Dialog's form. Possible values are "async", "form", and "manual". @config postmethod
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### configButtons

`public function configButtons(`String type`, `Object[] args`, `Object obj`)`
The default event handler for the "buttons" configuration property
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Dialog.

### configClose

`public function configClose(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "close" property is changed. The method controls the appending or hiding of the close icon at the top right of the Panel.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Panel.

### configConstrainToViewport

`public function configConstrainToViewport(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "constraintoviewport" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### configContext

`public function configContext(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "context" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### configDraggable

`public function configDraggable(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "draggable" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Panel.

### configFixedCenter

`public function configFixedCenter(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "fixedcenter" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### configHeight

`public function configHeight(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "height" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### configIframe

`public function configIframe(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "iframe" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### configKeyListeners

`public function configKeyListeners(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "keylisteners" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Panel.

### configModal

`public function configModal(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "modal" property is changed. This handler subscribes or unsubscribes to the show and hide events to handle the display or hide of the modality mask.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Panel.

### configUnderlay

`public function configUnderlay(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "underlay" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Panel.

### configVisible

`public function configVisible(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "visible" property is changed. This method is responsible for firing showEvent and hideEvent.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### configWidth

`public function configWidth(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "width" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### configX

`public function configX(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "x" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### configXY

`public function configXY(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "xy" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### configY

`public function configY(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "y" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### configzIndex

`public function configzIndex(`String type`, `Object[] args`, `Object obj`)`
The default event handler fired when the "zIndex" property is changed.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### destroy

`public function destroy()`
Removes the Overlay element from the DOM and sets all child elements to null.
Parameters:

- None.

Returns:

- `void`

This method is defined by Overlay.

### doCenterOnDOMEvent

`public function doCenterOnDOMEvent()`
Center event handler used for centering on scroll/resize, but only if the Overlay is visible
Parameters:

- None.

Returns:

- `void`

This method is defined by Overlay.

### doSubmit

`public function doSubmit()`
Performs the submission of the Dialog form depending on the value of "postmethod" property.
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### enforceConstraints

`public function enforceConstraints(`String type`, `Object[] args`, `Object obj`)`
The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true.
Parameters:

- `type` : String
  The CustomEvent type (usually the property name)
- `args` : Object[]
  The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
- `obj` : Object
  The scope object. For configuration handlers, this will usually equal the owner.

Returns:

- `void`

This method is defined by Overlay.

### focusDefaultButton

`public function focusDefaultButton()`
Sets the focus to the button that is designated as the default. By default, his handler is executed when the show event is fired.
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### focusFirst

`public function focusFirst()`
The default event handler used to focus the first field of the form when the Dialog is shown.
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### focusFirstButton

`public function focusFirstButton()`
Sets the focus to the first button in the button list
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### focusLast

`public function focusLast()`
Sets the focus to the last button in the button or form element in the Dialog
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### focusLastButton

`public function focusLastButton()`
Sets the focus to the first button in the button list
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### getData

`public function getData()`
Returns a JSON-compatible data structure representing the data currently contained in the form.
Parameters:

- None.

Returns:

- `Object`
  A JSON object reprsenting the data of the current form.

This method is defined by Dialog.

### hideIframe

`public function hideIframe()`
Hides the iframe shim, if it has been enabled
Parameters:

- None.

Returns:

- `void`

This method is defined by Overlay.

### hideMacGeckoScrollbars

`public function hideMacGeckoScrollbars()`
Adds a special CSS class to the Overlay when Mac/Gecko is in use, to work around a Gecko bug where scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
Parameters:

- None.

Returns:

- `void`

This method is defined by Overlay.

### hideMask

`public function hideMask()`
Hides the modality mask.
Parameters:

- None.

Returns:

- `void`

This method is defined by Panel.

### init

`public function init(`String el`, `HTMLElement el`, `Object userConfig`)`
The Dialog initialization method, which is executed for Dialog and all of its subclasses. This method is automatically called by the constructor, and sets up all DOM references for pre-existing markup, and creates required markup if it is not already present.
Parameters:

- `el` : String
  The element ID representing the Dialog OR
- `el` : HTMLElement
  The element representing the Dialog
- `userConfig` : Object
  The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.

Returns:

- `void`

This method is defined by Dialog.

### initDefaultConfig

`public function initDefaultConfig()`
Initializes the class's configurable properties which can be changed using the Dialog's Config object (cfg).
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### initEvents

`public function initEvents()`
Initializes the custom events for Dialog which are fired automatically at appropriate times by the Dialog class.
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### moveTo

`public function moveTo(`Number x`, `Number y`)`
Moves the Overlay to the specified position. This function is identical to calling this.cfg.setProperty("xy", [x,y]);
Parameters:

- `x` : Number
  The Overlay's new x position
- `y` : Number
  The Overlay's new y position

Returns:

- `void`

This method is defined by Overlay.

### onDomResize

`public function onDomResize(`DOMEvent e`, `Object obj`)`
Event handler fired when the resize monitor element is resized.
Parameters:

- `e` : DOMEvent
  The resize DOM event
- `obj` : Object
  The scope object

Returns:

- `void`

This method is defined by Overlay.

### registerDragDrop

`public function registerDragDrop()`
Registers the Panel's header for drag & drop capability.
Parameters:

- None.

Returns:

- `void`

This method is defined by Panel.

### registerForm

`public function registerForm()`
Prepares the Dialog's internal FORM object, creating one if one is not currently present.
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### removeMask

`public function removeMask()`
Removes the modality mask.
Parameters:

- None.

Returns:

- `void`

This method is defined by Panel.

### render

`public function render(`String appendToNode`, `HTMLElement appendToNode`)`
Renders the Panel by inserting the elements that are not already in the main Panel into their correct places. Optionally appends the Panel to the specified node prior to the render's execution. NOTE: For Panels without existing markup, the appendToNode argument is REQUIRED. If this argument is ommitted and the current element is not present in the document, the function will return false, indicating that the render was a failure.
Parameters:

- `appendToNode` : String
  The element id to which the Module should be appended to prior to rendering OR
- `appendToNode` : HTMLElement
  The element to which the Module should be appended to prior to rendering

Returns:

- `boolean`
  Success or failure of the render

This method is defined by Panel.

### showIframe

`public function showIframe()`
Shows the iframe shim, if it has been enabled
Parameters:

- None.

Returns:

- `void`

This method is defined by Overlay.

### showMacGeckoScrollbars

`public function showMacGeckoScrollbars()`
Removes a special CSS class from the Overlay when Mac/Gecko is in use, to work around a Gecko bug where scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
Parameters:

- None.

Returns:

- `void`

This method is defined by Overlay.

### showMask

`public function showMask()`
Shows the modality mask.
Parameters:

- None.

Returns:

- `void`

This method is defined by Panel.

### sizeMask

`public function sizeMask()`
Sets the size of the modality mask to cover the entire scrollable area of the document
Parameters:

- None.

Returns:

- `void`

This method is defined by Panel.

### sizeUnderlay

`public function sizeUnderlay()`
Adjusts the size of the shadow based on the size of the element.
Parameters:

- None.

Returns:

- `void`

This method is defined by Panel.

### submit

`public function submit()`
Executes a submit of the Dialog followed by a hide, if validation is successful.
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### syncPosition

`public function syncPosition()`
Synchronizes the Panel's "xy", "x", and "y" properties with the Panel's position in the DOM. This is primarily used to update position information during drag & drop.
Parameters:

- None.

Returns:

- `void`

This method is defined by Overlay.

### toString

`public function toString()`
Returns a string representation of the object.
Parameters:

- None.

Returns:

- `String`
  The string representation of the Dialog

This method is defined by Dialog.

### validate

`public function validate()`
Built-in function hook for writing a validation function that will be checked for a "true" value prior to a submit. This function, as implemented by default, always returns true, so it should be overridden if validation is necessary.
Parameters:

- None.

Returns:

- `void`

This method is defined by Dialog.

### windowResizeHandler<static>

`public function windowResizeHandler<static>(`DOMEvent e`)`
<static> The DOM event handler used to fire the CustomEvent for window resize
Parameters:

- `e` : DOMEvent
  The DOM resize event

Returns:

- `void`

This method is defined by Overlay.

### windowScrollHandler<static>

`public function windowScrollHandler<static>(`DOMEvent e`)`
<static> The DOM event handler used to fire the CustomEvent for window scroll
Parameters:

- `e` : DOMEvent
  The DOM scroll event

Returns:

- `void`

This method is defined by Overlay.

## Event Details

### YAHOO.widget.Overlay.windowResizeEvent

`public event YAHOO.widget.Overlay.windowResizeEvent`
A singleton CustomEvent used for reacting to the DOM event for window resize
Subscribers will be called with the following parameters:

- None.

This event is defined by Overlay.

### YAHOO.widget.Overlay.windowScrollEvent

`public event YAHOO.widget.Overlay.windowScrollEvent`
A singleton CustomEvent used for reacting to the DOM event for window scroll
Subscribers will be called with the following parameters:

- None.

This event is defined by Overlay.

### asyncSubmitEvent

`public event asyncSubmitEvent`
CustomEvent fired prior to asynchronous submission
Subscribers will be called with the following parameters:

- None.

This event is defined by Dialog.

### beforeMoveEvent

`public event beforeMoveEvent`
CustomEvent fired before the Overlay is moved.
Subscribers will be called with the following parameters:

- `x` : Number
  x coordinate
- `y` : Number
  y coordinate

This event is defined by Overlay.

### beforeSumitEvent

`public event beforeSumitEvent`
CustomEvent fired prior to submission
Subscribers will be called with the following parameters:

- None.

This event is defined by Dialog.

### cancelEvent

`public event cancelEvent`
CustomEvent fired after cancel
Subscribers will be called with the following parameters:

- None.

This event is defined by Dialog.

### dragEvent

`public event dragEvent`
CustomEvent when the Panel is dragged
Subscribers will be called with the following parameters:

- None.

This event is defined by Panel.

### formSubmitEvent

`public event formSubmitEvent`
CustomEvent fired prior to form-based submission
Subscribers will be called with the following parameters:

- None.

This event is defined by Dialog.

### hideMaskEvent

`public event hideMaskEvent`
CustomEvent fired after the modality mask is hidden
Subscribers will be called with the following parameters:

- None.

This event is defined by Panel.

### manualSubmitEvent

`public event manualSubmitEvent`
CustomEvent fired prior to manual submission
Subscribers will be called with the following parameters:

- None.

This event is defined by Dialog.

### moveEvent

`public event moveEvent`
CustomEvent fired after the Overlay is moved.
Subscribers will be called with the following parameters:

- `x` : Number
  x coordinate
- `y` : Number
  y coordinate

This event is defined by Overlay.

### showMaskEvent

`public event showMaskEvent`
CustomEvent fired after the modality mask is shown
Subscribers will be called with the following parameters:

- None.

This event is defined by Panel.

### submitEvent

`public event submitEvent`
CustomEvent fired after submission
Subscribers will be called with the following parameters:

- None.

This event is defined by Dialog.

Copyright © 2006 Jack Slocum. All rights reserved.