An interactive window appearing on request displaying information to the user. The API supports features such as popups with fixed sizes, popups with unlimited width, scrolling bars for large windows, and control nesting (for example, a drop-down list can be included in the window).
Constructor for a new Dialog.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.
new sap.ui.commons.Dialog(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new control, generated automatically if no ID is given |
|
mSettings? | object | Initial settings for the new control |
Name | Type | Default Value | Description |
---|---|---|---|
accessibleRole | sap.ui.core.AccessibleRole | Dialog | The ARIA role for the control. E.g. for alert-style Dialogs this can be set to "AlertDialog". Visibility: public |
applyContentPadding | boolean | true | Padding is theme-dependent. When set to "false", the content extends to the dialog borders. Visibility: public |
autoClose | boolean | false | If this property is set to true the Dialog will close if the Dialog loses its focus |
contentBorderDesign | sap.ui.commons.enums.BorderDesign | None | Specifies the border design. Border design is theme dependent. Visibility: public |
height | sap.ui.core.CSSSize | Outer height of dialog window. When not set and not constrained by one of the height parameters (minHeight/maxHeight), the window size is automatically adapted to the content. Visibility: public |
|
keepInWindow | boolean | false | Specifies whether Dialog movement should be restricted to the visible area of the window. This only affects drag&drop movements by the user. This doesn't affect modal dialogs -> modal dialogs always stay in the window. |
maxHeight | sap.ui.core.CSSSize | Maximum outer height of the dialog window. If set, neither the user nor some layout settings can make the window larger. Visibility: public |
|
maxWidth | sap.ui.core.CSSSize | Maximum outer width of the dialog window. If set, neither the user nor some layout settings can make the window larger. Visibility: public |
|
minHeight | sap.ui.core.CSSSize | Minimum outer height of the dialog window. When set, neither the user nor some layout settings can make the window smaller. Visibility: public |
|
minWidth | sap.ui.core.CSSSize | Minimum outer width of the dialog window. When set, neither the user nor some layout settings can make the window smaller. Visibility: public |
|
modal | boolean | false | Specifies whether the dialog should be modal, or not. In case of |
resizable | boolean | true | Specifies whether the dialog window can be resized by the user. The dialog frame contains the visual symbol. Visibility: public |
scrollLeft | int | 0 | Scroll position from left to right. "0" means leftmost position. Visibility: public |
scrollTop | int | 0 | Scroll position from top to bottom. "0" means topmost position. Visibility: public |
showCloseButton | boolean | true | Displays a close button in the title bar. Visibility: public |
title | string | empty string | Dialog title displayed in the header. Visibility: public |
width | sap.ui.core.CSSSize | Outer width of dialog window. When not set and not constrained by one of the width parameters (minWidth/maxWidth), the window size is automatically adapted to the content. Visibility: public |
Default Aggregation: content
Name | Cardinality | Type | Description |
---|---|---|---|
buttons | 0..n | sap.ui.core.Control |
Aggregation of the buttons to display at the bottom of the dialog, for example OK and Cancel. Association defaultButton can be used for one of the defined buttons. |
content (default) | 0..n | sap.ui.core.Control |
Aggregation of the content of the dialog (one or more controls). Warning: when content is added with width given as a percentage, the Dialog itself should have a width set. |
Name | Cardinality | Type | Description |
---|---|---|---|
defaultButton | 0..1 | sap.ui.commons.Button |
Defines one of the buttons that have been provided via button aggregation to be the default button. This default button is initially selected, if no control is set via the initialFocus association explicitly. The default button is activated when Enter is pressed in the context of the dialog and when the currently selected element does not handle the Enter event itself. |
initialFocus | 0..1 | sap.ui.core.Control |
Defines the control that shall get the focus when the dialog is opened. |
Event | Description |
---|---|
closed |
Event is fired when the dialog has been closed (after closing-animation etc.). Event parameters provide information about last position and last size. |
Event is fired when the dialog has been closed (after closing-animation etc.). Event parameters provide information about last position and last size.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
width | int |
The width of the dialog when closed |
height | int |
The height of the dialog when closed |
top | int |
The top position of the dialog when closed |
left | int |
The left position of the dialog when closed |
Method | Description |
---|---|
addButton |
Adds some button to the aggregation buttons. |
addContent |
Adds some content to the aggregation content. |
attachClosed |
Attaches event handler When called, the context of the event handler (its Event is fired when the dialog has been closed (after closing-animation etc.). Event parameters provide information about last position and last size. |
close |
Closes the dialog control instance. |
destroyButtons |
Destroys all the buttons in the aggregation buttons. |
destroyContent |
Destroys all the content in the aggregation content. |
detachClosed |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.commons.Dialog.extend |
Creates a new subclass of class sap.ui.commons.Dialog with name
|
fireClosed |
Fires event closed to attached listeners. |
getAccessibleRole |
Gets current value of property accessibleRole. The ARIA role for the control. E.g. for alert-style Dialogs this can be set to "AlertDialog". Default value is |
getApplyContentPadding |
Gets current value of property applyContentPadding. Padding is theme-dependent. When set to "false", the content extends to the dialog borders. Default value is |
getAutoClose |
Gets current value of property autoClose. If this property is set to true the Dialog will close if the Dialog loses its focus Default value is |
getButtons |
Gets content of aggregation buttons. Aggregation of the buttons to display at the bottom of the dialog, for example OK and Cancel. Association defaultButton can be used for one of the defined buttons. |
getContent |
Gets content of aggregation content. Aggregation of the content of the dialog (one or more controls). Warning: when content is added with width given as a percentage, the Dialog itself should have a width set. |
getContentBorderDesign |
Gets current value of property contentBorderDesign. Specifies the border design. Border design is theme dependent. Default value is |
getDefaultButton |
ID of the element which is the current target of the association defaultButton, or |
getEnabled |
Determines whether the dialog is currently enabled or not. Applications can't control the enabled state via a property. A dialog is implicitly enabled depending on its |
getHeight |
Gets current value of property height. Outer height of dialog window. When not set and not constrained by one of the height parameters (minHeight/maxHeight), the window size is automatically adapted to the content. |
getInitialFocus |
ID of the element which is the current target of the association initialFocus, or |
getKeepInWindow |
Gets current value of property keepInWindow. Specifies whether Dialog movement should be restricted to the visible area of the window. This only affects drag&drop movements by the user. This doesn't affect modal dialogs -> modal dialogs always stay in the window. Default value is |
getMaxHeight |
Gets current value of property maxHeight. Maximum outer height of the dialog window. If set, neither the user nor some layout settings can make the window larger. |
getMaxWidth |
Gets current value of property maxWidth. Maximum outer width of the dialog window. If set, neither the user nor some layout settings can make the window larger. |
sap.ui.commons.Dialog.getMetadata |
Returns a metadata object for class sap.ui.commons.Dialog. |
getMinHeight |
Gets current value of property minHeight. Minimum outer height of the dialog window. When set, neither the user nor some layout settings can make the window smaller. |
getMinWidth |
Gets current value of property minWidth. Minimum outer width of the dialog window. When set, neither the user nor some layout settings can make the window smaller. |
getModal |
Gets current value of property modal. Specifies whether the dialog should be modal, or not. In case of Default value is |
getOpenState |
Indicates whether the Dialog is currently open, closed, or transitioning between these states. |
getResizable |
Gets current value of property resizable. Specifies whether the dialog window can be resized by the user. The dialog frame contains the visual symbol. Default value is |
getScrollLeft |
Gets current value of property scrollLeft. Scroll position from left to right. "0" means leftmost position. Default value is |
getScrollTop |
Gets current value of property scrollTop. Scroll position from top to bottom. "0" means topmost position. Default value is |
getShowCloseButton |
Gets current value of property showCloseButton. Displays a close button in the title bar. Default value is |
getTitle |
Gets current value of property title. Dialog title displayed in the header. Default value is |
getWidth |
Gets current value of property width. Outer width of dialog window. When not set and not constrained by one of the width parameters (minWidth/maxWidth), the window size is automatically adapted to the content. |
indexOfButton |
Checks for the provided |
indexOfContent |
Checks for the provided |
insertButton |
Inserts a button into the aggregation buttons. |
insertContent |
Inserts a content into the aggregation content. |
isOpen |
Indicates whether the Dialog is open (this includes opening and closing animations). For more detailed information about the current state check Dialog.getOpenState(). |
open |
Opens the dialog control instance. |
removeAllButtons |
Removes all the controls from the aggregation buttons. Additionally, it unregisters them from the hosting UIArea. |
removeAllContent |
Removes all the controls from the aggregation content. Additionally, it unregisters them from the hosting UIArea. |
removeButton |
Removes a button from the aggregation buttons. |
removeContent |
Removes a content from the aggregation content. |
setAccessibleRole |
Sets a new value for property accessibleRole. The ARIA role for the control. E.g. for alert-style Dialogs this can be set to "AlertDialog". When called with a value of Default value is |
setApplyContentPadding |
Sets a new value for property applyContentPadding. Padding is theme-dependent. When set to "false", the content extends to the dialog borders. When called with a value of Default value is |
setAutoClose |
Sets a new value for property autoClose. If this property is set to true the Dialog will close if the Dialog loses its focus When called with a value of Default value is |
setContentBorderDesign |
Sets a new value for property contentBorderDesign. Specifies the border design. Border design is theme dependent. When called with a value of Default value is |
setDefaultButton |
Sets the associated defaultButton. |
setHeight |
Sets a new value for property height. Outer height of dialog window. When not set and not constrained by one of the height parameters (minHeight/maxHeight), the window size is automatically adapted to the content. When called with a value of |
setInitialFocus |
Sets the associated initialFocus. |
setKeepInWindow |
Sets a new value for property keepInWindow. Specifies whether Dialog movement should be restricted to the visible area of the window. This only affects drag&drop movements by the user. This doesn't affect modal dialogs -> modal dialogs always stay in the window. When called with a value of Default value is |
setMaxHeight |
Sets a new value for property maxHeight. Maximum outer height of the dialog window. If set, neither the user nor some layout settings can make the window larger. When called with a value of |
setMaxWidth |
Sets a new value for property maxWidth. Maximum outer width of the dialog window. If set, neither the user nor some layout settings can make the window larger. When called with a value of |
setMinHeight |
Sets a new value for property minHeight. Minimum outer height of the dialog window. When set, neither the user nor some layout settings can make the window smaller. When called with a value of |
setMinWidth |
Sets a new value for property minWidth. Minimum outer width of the dialog window. When set, neither the user nor some layout settings can make the window smaller. When called with a value of |
setModal |
Sets a new value for property modal. Specifies whether the dialog should be modal, or not. In case of When called with a value of Default value is |
setResizable |
Sets a new value for property resizable. Specifies whether the dialog window can be resized by the user. The dialog frame contains the visual symbol. When called with a value of Default value is |
setScrollLeft |
Sets a new value for property scrollLeft. Scroll position from left to right. "0" means leftmost position. When called with a value of Default value is |
setScrollTop |
Sets a new value for property scrollTop. Scroll position from top to bottom. "0" means topmost position. When called with a value of Default value is |
setShowCloseButton |
Sets a new value for property showCloseButton. Displays a close button in the title bar. When called with a value of Default value is |
setTitle |
Sets a new value for property title. Dialog title displayed in the header. When called with a value of Default value is |
setWidth |
Sets a new value for property width. Outer width of dialog window. When not set and not constrained by one of the width parameters (minWidth/maxWidth), the window size is automatically adapted to the content. When called with a value of |
Adds some button to the aggregation buttons.
Param | Type | DefaultValue | Description |
---|---|---|---|
oButton | sap.ui.core.Control |
The button to add; if empty, nothing is inserted |
Adds some content to the aggregation content.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent | sap.ui.core.Control |
The content to add; if empty, nothing is inserted |
Attaches event handler fnFunction
to the closed event of this sap.ui.commons.Dialog
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.commons.Dialog
itself.
Event is fired when the dialog has been closed (after closing-animation etc.). Event parameters provide information about last position and last size.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Detaches event handler fnFunction
from the closed event of this sap.ui.commons.Dialog
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Creates a new subclass of class sap.ui.commons.Dialog with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.core.Control.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Fires event closed to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
width | int |
The width of the dialog when closed |
|
height | int |
The height of the dialog when closed |
|
top | int |
The top position of the dialog when closed |
|
left | int |
The left position of the dialog when closed |
Gets current value of property accessibleRole.
The ARIA role for the control. E.g. for alert-style Dialogs this can be set to "AlertDialog".
Default value is Dialog
.
Gets current value of property applyContentPadding.
Padding is theme-dependent. When set to "false", the content extends to the dialog borders.
Default value is true
.
Gets current value of property autoClose.
If this property is set to true the Dialog will close if the Dialog loses its focus
Default value is false
.
Gets content of aggregation buttons.
Aggregation of the buttons to display at the bottom of the dialog, for example OK and Cancel. Association defaultButton can be used for one of the defined buttons.
Gets content of aggregation content.
Aggregation of the content of the dialog (one or more controls).
Warning: when content is added with width given as a percentage, the Dialog itself should have a width set.
Gets current value of property contentBorderDesign.
Specifies the border design. Border design is theme dependent.
Default value is None
.
ID of the element which is the current target of the association defaultButton, or null
.
Determines whether the dialog is currently enabled or not.
Applications can't control the enabled state via a property. A dialog is implicitly enabled depending on its openState
. Descendant controls that honor the enabled state of their ancestors will appear disabled after the dialog is closed.
Gets current value of property height.
Outer height of dialog window. When not set and not constrained by one of the height parameters (minHeight/maxHeight), the window size is automatically adapted to the content.
ID of the element which is the current target of the association initialFocus, or null
.
Gets current value of property keepInWindow.
Specifies whether Dialog movement should be restricted to the visible area of the window. This only affects drag&drop movements by the user. This doesn't affect modal dialogs -> modal dialogs always stay in the window.
Default value is false
.
Gets current value of property maxHeight.
Maximum outer height of the dialog window. If set, neither the user nor some layout settings can make the window larger.
Gets current value of property maxWidth.
Maximum outer width of the dialog window. If set, neither the user nor some layout settings can make the window larger.
Gets current value of property minHeight.
Minimum outer height of the dialog window. When set, neither the user nor some layout settings can make the window smaller.
Gets current value of property minWidth.
Minimum outer width of the dialog window. When set, neither the user nor some layout settings can make the window smaller.
Gets current value of property modal.
Specifies whether the dialog should be modal, or not. In case of true
the focus is kept inside the dialog.
Default value is false
.
Indicates whether the Dialog is currently open, closed, or transitioning between these states.
Gets current value of property resizable.
Specifies whether the dialog window can be resized by the user. The dialog frame contains the visual symbol.
Default value is true
.
Gets current value of property scrollLeft.
Scroll position from left to right. "0" means leftmost position.
Default value is 0
.
Gets current value of property scrollTop.
Scroll position from top to bottom. "0" means topmost position.
Default value is 0
.
Gets current value of property showCloseButton.
Displays a close button in the title bar.
Default value is true
.
Gets current value of property title.
Dialog title displayed in the header.
Default value is empty string
.
Gets current value of property width.
Outer width of dialog window. When not set and not constrained by one of the width parameters (minWidth/maxWidth), the window size is automatically adapted to the content.
Checks for the provided sap.ui.core.Control
in the aggregation buttons. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oButton | sap.ui.core.Control |
The button whose index is looked for |
Checks for the provided sap.ui.core.Control
in the aggregation content. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent | sap.ui.core.Control |
The content whose index is looked for |
Inserts a button into the aggregation buttons.
Param | Type | DefaultValue | Description |
---|---|---|---|
oButton | sap.ui.core.Control |
The button to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Inserts a content into the aggregation content.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent | sap.ui.core.Control |
The content to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Indicates whether the Dialog is open (this includes opening and closing animations). For more detailed information about the current state check Dialog.getOpenState().
Removes all the controls from the aggregation buttons.
Additionally, it unregisters them from the hosting UIArea.
Removes all the controls from the aggregation content.
Additionally, it unregisters them from the hosting UIArea.
Removes a button from the aggregation buttons.
Param | Type | DefaultValue | Description |
---|---|---|---|
vButton | int string sap.ui.core.Control |
The button to remove or its index or id |
Removes a content from the aggregation content.
Param | Type | DefaultValue | Description |
---|---|---|---|
vContent | int string sap.ui.core.Control |
The content to remove or its index or id |
Sets a new value for property accessibleRole.
The ARIA role for the control. E.g. for alert-style Dialogs this can be set to "AlertDialog".
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Dialog
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sAccessibleRole | sap.ui.core.AccessibleRole | Dialog |
New value for property |
Sets a new value for property applyContentPadding.
Padding is theme-dependent. When set to "false", the content extends to the dialog borders.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bApplyContentPadding | boolean | true |
New value for property |
Sets a new value for property autoClose.
If this property is set to true the Dialog will close if the Dialog loses its focus
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bAutoClose | boolean | false |
New value for property |
Sets a new value for property contentBorderDesign.
Specifies the border design. Border design is theme dependent.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is None
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sContentBorderDesign | sap.ui.commons.enums.BorderDesign | None |
New value for property |
Sets the associated defaultButton.
Param | Type | DefaultValue | Description |
---|---|---|---|
oDefaultButton | sap.ui.core.ID sap.ui.commons.Button |
ID of an element which becomes the new target of this defaultButton association; alternatively, an element instance may be given |
Sets a new value for property height.
Outer height of dialog window. When not set and not constrained by one of the height parameters (minHeight/maxHeight), the window size is automatically adapted to the content.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sHeight | sap.ui.core.CSSSize |
New value for property |
Sets the associated initialFocus.
Param | Type | DefaultValue | Description |
---|---|---|---|
oInitialFocus | sap.ui.core.ID sap.ui.core.Control |
ID of an element which becomes the new target of this initialFocus association; alternatively, an element instance may be given |
Sets a new value for property keepInWindow.
Specifies whether Dialog movement should be restricted to the visible area of the window. This only affects drag&drop movements by the user. This doesn't affect modal dialogs -> modal dialogs always stay in the window.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bKeepInWindow | boolean | false |
New value for property |
Sets a new value for property maxHeight.
Maximum outer height of the dialog window. If set, neither the user nor some layout settings can make the window larger.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sMaxHeight | sap.ui.core.CSSSize |
New value for property |
Sets a new value for property maxWidth.
Maximum outer width of the dialog window. If set, neither the user nor some layout settings can make the window larger.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sMaxWidth | sap.ui.core.CSSSize |
New value for property |
Sets a new value for property minHeight.
Minimum outer height of the dialog window. When set, neither the user nor some layout settings can make the window smaller.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sMinHeight | sap.ui.core.CSSSize |
New value for property |
Sets a new value for property minWidth.
Minimum outer width of the dialog window. When set, neither the user nor some layout settings can make the window smaller.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sMinWidth | sap.ui.core.CSSSize |
New value for property |
Sets a new value for property modal.
Specifies whether the dialog should be modal, or not. In case of true
the focus is kept inside the dialog.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bModal | boolean | false |
New value for property |
Sets a new value for property resizable.
Specifies whether the dialog window can be resized by the user. The dialog frame contains the visual symbol.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bResizable | boolean | true |
New value for property |
Sets a new value for property scrollLeft.
Scroll position from left to right. "0" means leftmost position.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
Param | Type | DefaultValue | Description |
---|---|---|---|
iScrollLeft | int | 0 |
New value for property |
Sets a new value for property scrollTop.
Scroll position from top to bottom. "0" means topmost position.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
Param | Type | DefaultValue | Description |
---|---|---|---|
iScrollTop | int | 0 |
New value for property |
Sets a new value for property showCloseButton.
Displays a close button in the title bar.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bShowCloseButton | boolean | true |
New value for property |
Sets a new value for property title.
Dialog title displayed in the header.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is empty string
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTitle | string | '' |
New value for property |
Sets a new value for property width.
Outer width of dialog window. When not set and not constrained by one of the width parameters (minWidth/maxWidth), the window size is automatically adapted to the content.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWidth | sap.ui.core.CSSSize |
New value for property |