MessageStrip is a control that enables the embedding of application-related messages in the application. There are 4 types of messages: Information, Success, Warning and Error. Each message can have a close button, so that it can be removed from the UI if needed.
Since: 1.30.
Event Summary
close(oControlEvent)This event will be fired after the container is closed. Method Summary
sap.m.MessageStrip.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.MessageStrip with name sClassName
and enriches it with the information contained in oClassInfo
. attachClose(oData?, fnFunction, oListener?)Attaches event handler fnFunction
to the close
event of this sap.m.MessageStrip
. close()Closes the MessageStrip. destroyLink()Destroys the link in the aggregation link
. detachClose(fnFunction, oListener)Detaches event handler fnFunction
from the close
event of this sap.m.MessageStrip
. fireClose(mArguments?)Fires event close
to attached listeners. getLink()Gets content of aggregation link
. getText()Gets current value of property text
. getType()Gets current value of property type
. setCustomIcon(sCustomIcon)Sets a new value for property customIcon
. setLink(oLink)Sets the aggregated link
. setShowIcon(bShowIcon)Sets a new value for property showIcon
. setText(sText)Setter for property text. setType(sType)Setter for property type. addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
clone,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
getVisible,
hasStyleClass,
invalidate,
isBusy,
onAfterRendering,
onBeforeRendering,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
setVisible,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
init,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty Constructor Detail
new sap.m.MessageStrip(sId?, mSettings?)
Constructor for a new MessageStrip.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.
The supported settings are:
- Properties
- Aggregations
- link : sap.m.Link (default)
- Events
- close : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.
Parameters:
{string} | sId? | id for the new control, generated automatically if no id is given |
{object} | mSettings? | initial settings for the new control |
Event Detail
close(oControlEvent)
This event will be fired after the container is closed.
Parameters:
Method Detail
sap.m.MessageStrip.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.MessageStrip 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.m.MessageStrip.
Returns:
Attaches event handler
fnFunction
to the
close
event of this
sap.m.MessageStrip
.
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.m.MessageStrip
itself.
This event will be fired after the container is closed.
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.m.MessageStrip itself |
Returns:
close(): void
Closes the MessageStrip. This method sets the visible property of the MessageStrip to false. The MessageStrip can be shown again by setting the visible property to true.
Destroys the link in the aggregation link
.
Returns:
Detaches event handler
fnFunction
from the
close
event of this
sap.m.MessageStrip
.
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 close
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Gets current value of property
customIcon
.
Determines a custom icon which is displayed. If none is set, the default icon for this message type is used.
Default value is
.
Returns:
Gets content of aggregation
link
.
Adds a sap.m.Link control which will be displayed at the end of the message.
Returns:
getShowCloseButton(): boolean
Gets current value of property
showCloseButton
.
Determines if the message has a close button in the upper right corner.
Default value is false
.
Returns:
{boolean} | Value of property showCloseButton |
getShowIcon(): boolean
Gets current value of property
showIcon
.
Determines if an icon is displayed for the message.
Default value is false
.
Returns:
{boolean} | Value of property showIcon |
getText(): string
Gets current value of property
text
.
Determines the text of the message.
Default value is
.
Returns:
{string} | Value of property text |
Gets current value of property
type
.
Determines the type of messages that are displayed in the MessageStrip. Possible values are: Information (default), Success, Warning, Error. If None is passed, the value is set to Information and a warning is displayed in the console.
Default value is Information
.
Returns:
Sets a new value for property
customIcon
.
Determines a custom icon which is displayed. If none is set, the default icon for this message type is used.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is
.
Parameters:
Returns:
Sets the aggregated link
.
Parameters:
Returns:
Sets a new value for property
showCloseButton
.
Determines if the message has a close button in the upper right corner.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Parameters:
{boolean} | bShowCloseButton | New value for property showCloseButton |
Returns:
Sets a new value for property
showIcon
.
Determines if an icon is displayed for the message.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Parameters:
{boolean} | bShowIcon | New value for property showIcon |
Returns:
Setter for property text. Default value is empty/undefined
Parameters:
{string} | sText | new value for property text |
Returns:
Setter for property type. Default value is sap.ui.core.MessageType.Information
Parameters:
Returns: