sap.ui.commons.Dialog.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
Returns a metadata object for class sap.ui.commons.Dialog.
Returns:
Adds some button to the aggregation buttons
.
Parameters:
Returns:
Adds some content to the aggregation content
.
Parameters:
Returns:
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.
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.commons.Dialog itself |
Returns:
close()
Closes the dialog control instance.
Destroys all the buttons in the aggregation buttons
.
Returns:
Destroys all the content in the aggregation content
.
Returns:
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.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
Fires event
closed
to attached listeners.
Expects the following event parameters:
width
of type int
The width of the dialog when closedheight
of type int
The height of the dialog when closedtop
of type int
The top position of the dialog when closedleft
of type int
The left position of the dialog when closed
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
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
.
Returns:
getApplyContentPadding(): boolean
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
.
Returns:
{boolean} | Value of property applyContentPadding |
getAutoClose(): boolean
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
.
- Since:
- 1.10
Returns:
{boolean} | Value of property autoClose |
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.
Returns:
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.
Returns:
Gets current value of property
contentBorderDesign
.
Specifies the border design. Border design is theme dependent.
Default value is None
.
Returns:
ID of the element which is the current target of the association defaultButton
, or null
.
Returns:
getEnabled(): boolean
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.
Experimental API:Whether a dialog is regarded as "enabled" during the state transitions (OPENING, CLOSING) is not fully decided. Currently, it is enabled during the OPENING phase and disabled during the CLOSING phase. The only potential change would be to treat the OPENING phase as disabled as well. Applications should be prepared to receive events from "enabled" controls after they called open() on the dialog until close() is called on it. If the mentioned potential change should happen, the dialog will become enabled only after the transition to OPEN. Events from "enabled" children then can still only arrive between open() and close(), so applications that obey the previous rule should continue to work. Only end users or code that explicitly triggers pseudo user events will notice a difference.
A second aspect that might change is the visual behavior of the content: during the CLOSING phase it 'looks' enabled but in fact it is already disabled. This avoids unnecessary redraws for content that becomes hidden soon. Should this show to be confusing for end users, it might be changed.
- Experimental:
- Whether a dialog is regarded as "enabled" during the state transitions (OPENING, CLOSING) is not fully decided. Currently, it is enabled during the OPENING phase and disabled during the CLOSING phase. The only potential change would be to treat the OPENING phase as disabled as well. Applications should be prepared to receive events from "enabled" controls after they called open() on the dialog until close() is called on it. If the mentioned potential change should happen, the dialog will become enabled only after the transition to OPEN. Events from "enabled" children then can still only arrive between open() and close(), so applications that obey the previous rule should continue to work. Only end users or code that explicitly triggers pseudo user events will notice a difference.
A second aspect that might change is the visual behavior of the content: during the CLOSING phase it 'looks' enabled but in fact it is already disabled. This avoids unnecessary redraws for content that becomes hidden soon. Should this show to be confusing for end users, it might be changed.
Returns:
{boolean} | indicates whether the dialog is currently enabled or not. |
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.
Returns:
ID of the element which is the current target of the association initialFocus
, or null
.
Returns:
getKeepInWindow(): boolean
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
.
- Since:
- 1.9.0
Returns:
{boolean} | Value of property keepInWindow |
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.
Returns:
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.
Returns:
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.
Returns:
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.
Returns:
getModal(): boolean
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
.
Returns:
{boolean} | Value of property modal |
Indicates whether the Dialog is currently open, closed, or transitioning between these states.
Returns:
getResizable(): boolean
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
.
Returns:
{boolean} | Value of property resizable |
getScrollLeft(): int
Gets current value of property
scrollLeft
.
Scroll position from left to right. "0" means leftmost position.
Default value is 0
.
Returns:
{int} | Value of property scrollLeft |
getScrollTop(): int
Gets current value of property
scrollTop
.
Scroll position from top to bottom. "0" means topmost position.
Default value is 0
.
Returns:
{int} | Value of property scrollTop |
getShowCloseButton(): boolean
Gets current value of property
showCloseButton
.
Displays a close button in the title bar.
Default value is true
.
Returns:
{boolean} | Value of property showCloseButton |
getTitle(): string
Gets current value of property
title
.
Dialog title displayed in the header.
Default value is
.
Returns:
{string} | Value of property title |
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.
Returns:
indexOfButton(oButton): int
Checks for the provided sap.ui.core.Control
in the aggregation buttons
. and returns its index if found or -1 otherwise.
Parameters:
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
indexOfContent(oContent): int
Checks for the provided sap.ui.core.Control
in the aggregation content
. and returns its index if found or -1 otherwise.
Parameters:
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
Inserts a button into the aggregation buttons
.
Parameters:
{sap.ui.core.Control} | oButton | the button to insert; if empty, nothing is inserted |
{int} | iIndex | the 0 -based index the button should be inserted at; for a negative value of iIndex , the button is inserted at position 0; for a value greater than the current size of the aggregation, the button is inserted at the last position |
Returns:
Inserts a content into the aggregation content
.
Parameters:
{sap.ui.core.Control} | oContent | the content to insert; if empty, nothing is inserted |
{int} | iIndex | the 0 -based index the content should be inserted at; for a negative value of iIndex , the content is inserted at position 0; for a value greater than the current size of the aggregation, the content is inserted at the last position |
Returns:
isOpen(): boolean
Indicates whether the Dialog is open (this includes opening and closing animations). For more detailed information about the current state check Dialog.getOpenState().
Returns:
open()
Opens the dialog control instance.
Removes all the controls from the aggregation
buttons
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
Removes all the controls from the aggregation
content
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
Removes a button from the aggregation buttons
.
Parameters:
Returns:
Removes a content from the aggregation content
.
Parameters:
Returns:
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
.
Parameters:
Returns:
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
.
Parameters:
{boolean} | bApplyContentPadding | New value for property applyContentPadding |
Returns:
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
.
Parameters:
{boolean} | bAutoClose | New value for property autoClose |
- Since:
- 1.10
Returns:
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
.
Parameters:
Returns:
Sets the associated defaultButton
.
Parameters:
{sap.ui.commons.Button} | oDefaultButton | Id of an element which becomes the new target of this defaultButton association; alternatively, an element instance may be given |
Returns:
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.
Parameters:
Returns:
Sets the associated initialFocus
.
Parameters:
{sap.ui.core.Control} | oInitialFocus | Id of an element which becomes the new target of this initialFocus association; alternatively, an element instance may be given |
Returns:
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
.
Parameters:
{boolean} | bKeepInWindow | New value for property keepInWindow |
- Since:
- 1.9.0
Returns:
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.
Parameters:
Returns:
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.
Parameters:
Returns:
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.
Parameters:
Returns:
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.
Parameters:
Returns:
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
.
Parameters:
{boolean} | bModal | New value for property modal |
Returns:
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
.
Parameters:
{boolean} | bResizable | New value for property resizable |
Returns:
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
.
Parameters:
{int} | iScrollLeft | New value for property scrollLeft |
Returns:
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
.
Parameters:
{int} | iScrollTop | New value for property scrollTop |
Returns:
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
.
Parameters:
{boolean} | bShowCloseButton | New value for property showCloseButton |
Returns:
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
.
Parameters:
{string} | sTitle | New value for property title |
Returns:
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.
Parameters:
Returns: