sap.ui.app.Application.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.app.Application 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.Component.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.app.Application.
Returns:
Creates and returns the root component. Override this method in your application implementation, if you want to override the default creation by metadata.
Returns:
Destroys the rootComponent in the aggregation rootComponent
.
Returns:
getConfig(): any
Gets current value of property config
.
Returns:
{any} | Value of property config |
getRoot(): string
Gets current value of property root
.
Returns:
{string} | Value of property root |
Gets content of aggregation rootComponent
.
Returns:
main()
The main method is called when the DOM and UI5 is completely loaded. Override this method in your Application class implementation to execute code which relies on a loaded DOM / UI5.
onBeforeExit(): string
On before exit application hook. Override this method in your Application class implementation, to handle cleanup before the real exit or to prompt a question to the user, if the application should be exited.
Returns:
{string} | return a string if a prompt should be displayed to the user confirming closing the application (e.g. when the application is not yet saved). |
onError(sMessage, sFile, iLine)
On error hook. Override this method in your Application class implementation to listen to unhandled errors.
Parameters:
{string} | sMessage | The error message. |
{string} | sFile | The file where the error occurred |
{number} | iLine | The line number of the error |
onExit()
On exit application hook. Override this method in your Application class implementation, to handle cleanup of the application.
setConfig(vConfig)
Sets the configuration model.
Parameters:
{string|object|sap.ui.model.Model} | vConfig | the configuration model, the configuration object or a URI string to load a JSON configuration file. |
- Since:
- 1.13.1
Sets a new value for property
root
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
{string} | sRoot | New value for property root |
Returns:
Sets the aggregated rootComponent
.
Parameters:
Returns:
Returns the application root component.
- Deprecated:
- true
- Since:
- 1.13.1
Returns: