Dialog
This element should be used in place of the window element for dialog boxes. The buttons attribute may be used to set which buttons should appear in the dialog box. These buttons will be placed in the correct locations for the user's platform.
Attributes:
buttonalign | buttondir | buttonorient | buttonpack | buttons |
ondialogaccept | ondialogcancel | ondialogdisclosure | ondialoghelp | title |
Properties and Methods:
acceptDialog | buttons | cancelDialog | centerWindowOnScreen | enterDefaultAlways |
getButton | moveToAlertPosition |
Attributes:
Inherited from XUL Element:
align
allowevents
allownegativeassertions
class
coalesceduplicatearcs
collapsed
container
containment
context
contextmenu
datasources
debug
dir
empty
equalsize
flags
flex
height
hidden
id
insertafter
insertbefore
left
maxheight
maxwidth
menu
minheight
minwidth
mousethrough
observes
ordinal
orient
pack
persist
popup
position
ref
removeelement
sortDirection
sortResource
sortResource2
statustext
style
template
tooltip
tooltiptext
top
uri
wait-cursor
width
buttonalign
Type: string
The value of the 'align' attribute for the box containing the buttons.
buttondir
Type: string
The value of the 'dir' attribute for the box containing the buttons.
buttonorient
Type: string
The value of the 'orient' attribute for the box containing the buttons.
buttonpack
Type: string
The value of the 'pack' attribute for the box containing the buttons.
buttons
Type: comma-separated list of the values below
A comma-separated list of buttons to appear on the dialog box. The buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. The following values can be used in the list:
- accept: The OK button, which will accept the changes when pressed. This button will also be the default button.
- cancel: The cancel button which will cancel the operation.
- help: A help button for displaying help about the dialog.
- disclosure: A button to show more information. This might be a button or a disclosure triangle.
ondialogaccept
Type: script code
The code in this attribute is called when the OK button is pressed, or when the acceptDialog function is called.
ondialogcancel
Type: script code
The code in this attribute is called when the Cancel button is pressed, or when the cancelDialog function is called.
ondialogdisclosure
Type: script code
The code in this attribute is called when the disclosure button is pressed.
ondialoghelp
Type: script code
The code in this attribute is called when the Help button is pressed.
title
Type: string
The text to appear on the title bar of the dialog box.
Properties and Methods:
Inherited from XUL Element:
align
allowEvents
blur
boxObject
boxObject.element
boxObject.getLookAndFeelMetric
boxObject.height
boxObject.screenX
boxObject.screenY
boxObject.width
boxObject.x
boxObject.y
builder
className
click
collapsed
contextMenu
controllers
database
datasources
dir
doCommand
flex
focus
getElementsByAttribute
height
hidden
id
left
maxHeight
maxWidth
menu
minHeight
minWidth
observes
ordinal
orient
pack
persist
ref
resource
statusText
style
tooltip
tooltipText
top
width
Inherited from Element:
addEventListener
appendChild
attributes
childNodes
cloneNode
dispatchEvent
firstChild
getAttribute
getAttributeNS
getAttributeNode
getAttributeNodeNS
getElementsByTagName
getElementsByTagNameNS
hasAttribute
hasAttributeNS
hasAttributes
hasChildNodes
insertBefore
isSupported
lastChild
localName
namespaceURI
nextSibling
nodeName
nodeType
nodeValue
normalize
ownerDocument
parentNode
prefix
previousSibling
removeAttribute
removeAttributeNS
removeAttributeNode
removeChild
removeEventListener
replaceChild
setAttribute
setAttributeNS
setAttributeNode
setAttributeNodeNS
tagName
acceptButton ( )
Return Type: no return value
Accepts the dialog and closes it, similar to pressing the OK button.
buttons
Type: comma-separated list of the values below
A comma-separated list of buttons to appear on the dialog box. The buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. The following values can be used in the list:
- accept: The OK button, which will accept the changes when pressed. This button will also be the default button.
- cancel: The cancel button which will cancel the operation.
- help: A help button for displaying help about the dialog.
- disclosure: A button to show more information. This might be a button or a disclosure triangle.
cancelButton ( )
Return Type: no return value
Cancels the dialog and closes it, similar to pressing the Cancel button.
centerWindowOnScreen
Type: no return value
Centers the dialog on the screen.
enterDefaultAlways
Type: boolean
If set to true, pressing enter will always close the dialog, no matter which element is focused. If false, pressing Enter while another button is focused will not cause the dialog to close.
getButton ( type )
Return Type: button element
Returns the button element in the dialog corresponding to the given type.
moveToAlertPosition
Type: no return value
Moves and resizes the dialog to a position and size suitable for an alert box.