The InvisibleMessage provides a way to programmatically expose dynamic content changes in a way that can be announced by screen readers.
This class is a singleton. The class instance can be retrieved via the static method sap.ui.core.InvisibleMessage.getInstance.
Note: Keep in mind that, according to the ARIA standard, the live regions should be presented and should be empty. Thus, we recommend to instantiate InvisibleMessage
via sap.ui.core.InvisibleMessage.getInstance()
as early as possible in the application logic, e.g. with the Component initialization, with the main Controller initialization, after Core initialization, etc. Then, you should specify the text that has to be announced by the screen reader and the live region’s mode using the announce
method.
Method | Description |
---|---|
announce |
Inserts the string into the respective span, depending on the mode provided. |
sap.ui.core.InvisibleMessage.extend |
Creates a new subclass of class sap.ui.core.InvisibleMessage with name
|
sap.ui.core.InvisibleMessage.getInstance |
Returns the instance of the class. |
sap.ui.core.InvisibleMessage.getMetadata |
Returns a metadata object for class sap.ui.core.InvisibleMessage. |
Inserts the string into the respective span, depending on the mode provided.
Param | Type | DefaultValue | Description |
---|---|---|---|
sText | string |
String to be announced by the screen reader. |
|
sMode | sap.ui.core.InvisibleMessageMode |
The mode to be inserted in the aria-live attribute. |
Creates a new subclass of class sap.ui.core.InvisibleMessage 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.base.ManagedObject.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 |