0% found this document useful (0 votes)
9 views1 page

Alias: Demo Kit Nightly Build Demo Kit Latest Release

The <template:alias> instruction can be used to define an alias name for a JavaScript value like a class or function. The alias is only available within its scope but can be redefined in nested scopes. Existing aliases can be referenced when defining new aliases. Aliases are inherited by fragments but can be redefined within a fragment.

Uploaded by

zzg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Alias: Demo Kit Nightly Build Demo Kit Latest Release

The <template:alias> instruction can be used to define an alias name for a JavaScript value like a class or function. The alias is only available within its scope but can be redefined in nested scopes. Existing aliases can be referenced when defining new aliases. Aliases are inherited by fragments but can be redefined within a fragment.

Uploaded by

zzg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

loio

ac5751f89cb142b7a6d53eaf8a0f6339
view on: demo kit nightly build | demo kit latest release

alias
The <template:alias> instruction can be used to define a shortcut alias name for a
JavaScript value, for example a static helper class, a formatter function, or a helper function.
The shortcut alias is only available in the scope of the alias instruction. Each nested scope
can redefine aliases.
A proper relative name must be used. This proper name must not contain or consist of a
dot. The value to which the alias refers to can be any JavaScript object or property
including a function that is available at that point. Exisiting alias names can be used in new
alias definitions to refer to values, for example, <template:alias name="format"
value="AH.format">. Aliases are inherited into fragments, but of course a fragment may
(re)define its own set of aliases. For compatibility reasons, aliases can also start with a dot,
both in definition and in references.

“alias” Template
<template:alias name="AH" value="sap.ui.model.odata.AnnotationHelper">
<template:with path="meta>com.sap.vocabularies.UI.v1.Badge" var="badge">
<form:SimpleForm>
<form:title>
<core:Title text="{path: 'badge>HeadLine', formatter: 'AH.format'}"/>
</form:title>
<Label text="{path: 'badge>Title/Label', formatter: 'AH.format'}"/>
<Text text="{path: 'badge>Title/Value', formatter: 'AH.format'}"/>
<Label text="{path: 'badge>MainInfo/Label', formatter: 'AH.format'}"/>
<template:with path="badge>MainInfo" var="field">
<core:Fragment
fragmentName="sap.ui.core.sample.ViewTemplate.tiny.Field" type="XML"/>
</template:with>
<Label text="{path: 'badge>SecondaryInfo/Label', formatter:
'AH.format'}"/>
<template:with path="badge>SecondaryInfo" var="field">
<core:Fragment
fragmentName="sap.ui.core.sample.ViewTemplate.tiny.Field" type="XML"/>
</template:with>
</form:SimpleForm>
</template:with>
</template:alias>

You might also like