sap.ui.core.tmpl.Template
- Test Page
Text Template (using "text" expression)
{{text path="/title"}}:
{{#each path="/persons"}}
- {{text path="firstName"}} {{text path="lastName"}}
{{/each}}
Advanced Text Template (using "element" expression)
{{element tag="b" text="{/title}"}}:
{{#each path="/persons"}}
{{element tag="li" text="{firstName} {lastName}"}}
{{/each}}
Advanced Text Template (using editable "element" expression)
{{element tag="textarea" text="{/title}" rows="2" cols="40"}}
{{#each path="/persons"}}
- {{element tag="input" value="{firstName}"}} {{element tag="input" value="{lastName}"}}
{{/each}}
Control Template (using "control" expression)
{{control sap-ui-type="sap.ui.commons.Label" design="Bold" text="{/title}"}}
{{#each path="/persons"}}
- {{control sap-ui-type="sap.ui.commons.TextView" text="{lastName}, {firstName}"}}
{{/each}}
Advanced Control Template (using editable "control" expression)
{{control sap-ui-type="sap.ui.commons.TextArea" value="{/title}" rows="2" cols="40"}}
{{#each path="/persons"}}
- {{control sap-ui-type="sap.ui.commons.TextField" value="{lastName}"}}, {{control sap-ui-type="sap.ui.commons.TextField" value="{firstName}"}}
{{/each}}
Helpers Template (example for if/unless helper support)
{{text path="/title"}} (checked):
{{#each path="/persons"}}
{{#if path="checked"}}
- {{text path="firstName"}} {{text path="lastName"}}
{{/if}}
{{/each}}
{{text path="/title"}} (unchecked):
{{#each path="/persons"}}
{{#unless path="checked"}}
- {{text path="firstName"}} {{text path="lastName"}}
{{/unless}}
{{/each}}