Class sap.ui.core.routing.ViewsModule: sap/ui/core/routing/Views



Since: 1.28.1.
Constructor Summary
new sap.ui.core.routing.Views(oOptions)Instantiates a view repository that creates and caches views.
Event Summary
created(oEvent)If a view is created the event will be fired.
Method Summary
sap.ui.core.routing.Views.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.routing.Views with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.core.routing.Views.getMetadata()Returns a metadata object for class sap.ui.core.routing.Views.
attachCreated(oData?, fnFunction, oListener?)Attach event-handler fnFunction to the 'created' event of this sap.ui.core.routing.Views.
detachCreated(fnFunction, oListener)Detach event-handler fnFunction from the 'created' event of this sap.ui.core.routing.Views.
fireCreated(mArguments?)Fire event created to attached listeners.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.core.routing.Views(oOptions)
Instantiates a view repository that creates and caches views. If it is destroyed, all the Views it created are destroyed. Usually you do not have to create instances of this class, it is used by the sap.ui.core.routing.Router. If you are using sap.ui.core.routing.Targets without using a sap.ui.core.UIComponent you have to create an instance of this class. They will create an instance on their own, or if they are used with a sap.ui.core.UIComponent they will share the same instance of Views.
Parameters:
{object}oOptions
{sap.ui.core.UIComponent}oOptions.component? the owner of all the views that will be created by this Instance.
{boolean}oOptions.async? @since 1.34 Whether the views which are created through this Views are loaded asyncly. This option can be set only when the Views is used standalone without the involvement of a Router. Otherwise the async option is inherited from the Router.
Event Detail
created(oEvent)
If a view is created the event will be fired. It will not be fired, if a view was read from the cache of the Views object.
Parameters:
{sap.ui.base.Event}oEvent refer to sap.ui.base.EventProvider for details about getSource and getParameters
{sap.ui.base.EventProvider}oEvent.getSource
{object}oEvent.getParameters
{sap.ui.core.mvc.View}oEvent.getParameters.view the instance of the created view.
{object}oEvent.getParameters.viewOptions The view options passed to sap.ui.view
Method Detail
sap.ui.core.routing.Views.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.core.routing.Views 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.EventProvider.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.core.routing.Views.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.routing.Views.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachCreated(oData?, fnFunction, oListener?): sap.ui.core.routing.Views
Attach event-handler fnFunction to the 'created' event of this sap.ui.core.routing.Views.
Parameters:
{object}oData? The object, that should be passed along with the event-object when firing the event.
{function}fnFunction The function to call, when the event occurs. This function will be called on the oListener-instance (if present) or in a 'static way'.
{object}oListener? Object on which to call the given function.
Returns:
{sap.ui.core.routing.Views}this to allow method chaining
detachCreated(fnFunction, oListener): sap.ui.core.routing.Views
Detach event-handler fnFunction from the 'created' event of this sap.ui.core.routing.Views.

The passed function and listener object must match the ones previously used for event registration.

Parameters:
{function}fnFunction The function to call, when the event occurs.
{object}oListener Object on which the given function had to be called.
Returns:
{sap.ui.core.routing.Views}this to allow method chaining
fireCreated(mArguments?): sap.ui.core.routing.Views
Fire event created to attached listeners.
Parameters:
{object}mArguments? the arguments to pass along with the event.
Returns:
{sap.ui.core.routing.Views}this to allow method chaining