Base Class for Template.
Experimental API:Since 1.15.0. The Template concept is still under construction, so some implementation details can be changed in future.
Method Summary
sap.ui.core.tmpl.Template.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.tmpl.Template with name sClassName
and enriches it with the information contained in oClassInfo
. createControl(sId, oContext?, oView)Creates an anonymous TemplateControl for the Template. declareControl(sControl)Declares a new control based on this template and returns the created class / constructor function. getContent()Gets current value of property content
. placeAt(oRef, oContext?, vPosition?, bInline)Creates an anonymous TemplateControl for the Template and places the control into the specified DOM element. setContent(sContent)Sets a new value for property content
. addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
clone,
destroy,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getMetadata,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
invalidate,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
toString,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty Constructor Detail
new sap.ui.core.tmpl.Template(sId?, mSettings?)
Creates and initializes a new template with the given
sId
and settings.
The set of allowed entries in the mSettings
object depends on the concrete subclass and is described there.
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.base.ManagedObject can be used as well.
Parameters:
{string} | sId? | optional id for the new template; 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 component instance |
Method Detail
Returns the registered template for the given id, if any.
Parameters:
Returns:
sap.ui.core.tmpl.Template.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.core.tmpl.Template 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.
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.core.tmpl.Template.
Returns:
sap.ui.core.tmpl.Template.parsePath(sPath): object
parses the given path and extracts the model and path
Parameters:
Returns:
{object} | the model and the path |
Creates an anonymous TemplateControl for the Template.
Parameters:
{string} | sId | the control ID |
{object} | oContext? | the context for the renderer/templating |
{sap.ui.core.mvc.View} | oView | |
Returns:
declareControl(sControl): function
Declares a new control based on this template and returns the created class / constructor function. The class is based on the information coming from the abstract functions createMetadata
and createRenderer
.
Parameters:
{string} | sControl | the fully qualified name of the control |
Returns:
{function} | the created class / constructor function |
getContent(): string
Gets current value of property
content
.
The Template definition as a String.
Returns:
{string} | Value of property content |
Creates an anonymous TemplateControl for the Template and places the control into the specified DOM element.
Parameters:
{string|DomRef} | oRef | the id or the DOM reference where to render the template |
{object} | oContext? | The context to use to evaluate the Template. It will be applied as value for the context property of the created control. |
{string|int} | vPosition? | Describes the position where the control should be put into the container |
{boolean} | bInline | |
Returns:
Sets a new value for property
content
.
The Template definition as a String.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
{string} | sContent | New value for property content |
Returns: