Top

Template

Contents

Template widget allows application developer to include external template file in a template. This allows for gathering of common code into a sub template.

The simple way to add Template widget to your application is as follows

File /widgets/template/Snippet.tpl
{@aria:Template {

    id:"myFirstTemplate",
    defaultTemplate: 'ariadoc.samples.widgets.template.FirstSubTemplate'

} /}

Also the data can be passed from the parent template to the sub template via data property. If no data is set, the the sub template uses parent template data, unless moduleCtrl is specified, in which case the data model of that module controller is used as data.

File /widgets/template/Snippet.tpl
{@aria:Template {

    id:"mySecondTemplate",
    defaultTemplate: "ariadoc.samples.widgets.template.SecondSubTemplate",
    data: {
      myMessage : "This is just a message from the parent template."
    }

} /}

The whole list of configuration parameters is available in TemplateCfg bean.

Binding

The only property bindable for template is

  • tooltip

For more information please read the article on Widget Bindings.

and has been viewed 876 times.