Class sap.ui.core.routing.TargetModule: sap/ui/core/routing/Target



Since: 1.28.1.
Constructor Summary
new sap.ui.core.routing.Target(oOptions, oViews, oParent?)Provides a convenient way for placing views into the correct containers of your application.
Event Summary
display(oEvent)Will be fired when a target is displayed

Could be triggered by calling the display function or by the @link sap.ui.core.routing.Router when a target is referenced in a matching route.

Method Summary
sap.ui.core.routing.Target.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.routing.Target with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.core.routing.Target.getMetadata()Returns a metadata object for class sap.ui.core.routing.Target.
attachDisplay(oData?, fnFunction, oListener?)Attach event-handler fnFunction to the 'display' event of this sap.ui.core.routing.Target.
destroy()Destroys the target, will be called by sap.m.routing.Targets don't call this directly.
detachDisplay(fnFunction, oListener)Detach event-handler fnFunction from the 'display' event of this sap.ui.core.routing.Target.
display(vData?)Creates a view and puts it in an aggregation of a control that has been defined in the sap.ui.core.routing.Target.
fireDisplay(mArguments?)Fire event created to attached listeners.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.core.routing.Target(oOptions, oViews, oParent?)
Provides a convenient way for placing views into the correct containers of your application.
The main benefit of Targets is lazy loading: you do not have to create the views until you really need them.
Don't call this constructor directly, use sap.ui.core.routing.Targets instead, it will create instances of a Target.
If you are using the mobile library, please use the sap.m.routing.Targets constructor, please read the documentation there.
Parameters:
{object}oOptions all of the parameters defined in sap.m.routing.Targets are accepted here, except for children you need to specify the parent.
{sap.ui.core.routing.Views}oViews All views required by this target will get created by the views instance using sap.ui.core.routing.Views#getView
{sap.ui.core.routing.Target}oParent? the parent of this target. Will also get displayed, if you display this target. In the config you have the fill the children property sap.m.routing.Targets
Event Detail
display(oEvent)
Will be fired when a target is displayed

Could be triggered by calling the display function or by the @link sap.ui.core.routing.Router when a target is referenced in a matching route.

Parameters:
{object}oEvent
{sap.ui.base.EventProvider}oEvent.getSource
{object}oEvent.getParameters
{object}oEvent.getParameters.view The view that got displayed.
{object}oEvent.getParameters.control The control that now contains the view in the controlAggregation
{object}oEvent.getParameters.config The options object passed to the constructor sap.ui.core.routing.Target#constuctor
{object}oEvent.getParameters.data The data passed into the sap.ui.core.routing.Target#display function
Method Detail
sap.ui.core.routing.Target.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.core.routing.Target 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.Target.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.routing.Target.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachDisplay(oData?, fnFunction, oListener?): sap.ui.core.routing.Target
Attach event-handler fnFunction to the 'display' event of this sap.ui.core.routing.Target.
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.Target}this to allow method chaining
Destroys the target, will be called by sap.m.routing.Targets don't call this directly.
Returns:
{sap.ui.core.routing.Target} this for chaining.
detachDisplay(fnFunction, oListener): sap.ui.core.routing.Target
Detach event-handler fnFunction from the 'display' event of this sap.ui.core.routing.Target.

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.Target}this to allow method chaining
display(vData?): Promise
Creates a view and puts it in an aggregation of a control that has been defined in the sap.ui.core.routing.Target.
Parameters:
{*}vData? an object that will be passed to the display event in the data property. If the target has parents, the data will also be passed to them.
Returns:
{Promise} resolves with {name: *, view: *, control: *} if the target can be successfully displayed otherwise it resolves with {name: *, error: *}
fireDisplay(mArguments?): sap.ui.core.routing.Target
Fire event created to attached listeners.
Parameters:
{object}mArguments? the arguments to pass along with the event.
Returns:
{sap.ui.core.routing.Target}this to allow method chaining