Abstract Class sap.ui.app.ApplicationModule: sap/ui/app/Application

extends Component

Base class for application classes

Deprecated API:Since 1.15.1. The Component class is enhanced to take care about the Application code.

Experimental API:Since 1.11.1. The Application class is still under construction, so some implementation details can be changed in future.

Constructor Summary
new sap.ui.app.Application(sId?, mSettings?)Abstract application class.
Method Summary
sap.ui.app.Application.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.app.Application with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.app.Application.getMetadata()Returns a metadata object for class sap.ui.app.Application.
createRootComponent()Creates and returns the root component.
destroyRootComponent()Destroys the rootComponent in the aggregation rootComponent.
getConfig()Gets current value of property config.
getRoot()Gets current value of property root.
getRootComponent()Gets content of aggregation rootComponent.
main()The main method is called when the DOM and UI5 is completely loaded.
onBeforeExit()On before exit application hook.
onError(sMessage, sFile, iLine)On error hook.
onExit()On exit application hook.
setConfig(vConfig)Sets the configuration model.
setRoot(sRoot)Sets a new value for property root.
setRootComponent(oRootComponent)Sets the aggregated rootComponent.
getView()Returns the application root component.
Constructor Detail
new sap.ui.app.Application(sId?, mSettings?)
Abstract application class. Extend this class to create a central application class.

Only one instance is allowed.

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:

In addition, all settings applicable to the base type sap.ui.core.Component can be used as well.

Parameters:
{string}sId? optional id for the application; generated automatically if no non-empty id is given Note: this can be omitted, no matter whether mSettings will be given or not!
{object}mSettings? optional map/JSON-object with initial settings for the new application instance
Deprecated:
Since 1.15.1. The Component class is enhanced to take care about the Application code.
Method Detail
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
sap.ui.app.Application.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.app.Application.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
createRootComponent(): sap.ui.core.UIComponent
Creates and returns the root component. Override this method in your application implementation, if you want to override the default creation by metadata.
Returns:
{sap.ui.core.UIComponent} the root component
destroyRootComponent(): sap.ui.app.Application
Destroys the rootComponent in the aggregation rootComponent.
Returns:
{sap.ui.app.Application} Reference to this in order to allow method chaining
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
getRootComponent(): sap.ui.core.UIComponent
Gets content of aggregation rootComponent.
Returns:
{sap.ui.core.UIComponent}
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
setRoot(sRoot): sap.ui.app.Application
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:
{sap.ui.app.Application} Reference to this in order to allow method chaining
setRootComponent(oRootComponent): sap.ui.app.Application
Sets the aggregated rootComponent.
Parameters:
{sap.ui.core.UIComponent}oRootComponent The rootComponent to set
Returns:
{sap.ui.app.Application} Reference to this in order to allow method chaining
Returns the application root component.
Deprecated:
true
Since:
1.13.1
Returns:
{sap.ui.core.Control} The root component