Aria Templates Patterns

How to migrate to Aria Templates with noder-js

As explained in this blog article, the latest non-backward-compatible release of Aria Templates (1.6.1) changes the way in which dependencies are managed by the framework. Thanks to the integration of noder-js, you are able to retrieve the dependencies you need in your modules with the require syntax, as dictated by the CommonJS specifications. The purpose of this …

Deprecation of the section used as a container

Since the version 1.4-10, the usage of a section with a macro becomes the only supported way to use a section, as follow: {section {id: "sectionId", macro: "mySectionContent"} /} {macro mySectionContent}   // Section content {/macro} Or, with some parameters: {section {   id: "sectionId",   macro: {     name: "mySectionContent",     args: …

Using iframes in an Aria Templates application

Introduction Aria Templates is based on client-side templating: as templates are stored client side, if a piece of data changes, there is no need to manipulate DOM elements to update the UI, it is only needed to refresh a template or a part of it. When a template is refreshed, the Aria Templates framework erases …

Shifting from actions to data model

In traditional development when describing how the user interacts with the system we often describe it in terms of actions. the user types in the search field, selects some options and clicks on the button to get search results This requirement becomes the following piece of code $("search_button").click(function () {   var searchString = $("search_field").val(); …

Refresh strategy in complex templates

In a Rich Internet Application, the user interface has to reactively change upon user interaction or after receiving data from the server. Aria Templates offers several mechanisms for refreshing the view (as explained in this article). Full or partial refresh? It is possible to trigger the refresh of a template by calling the $refresh method …

Templates vs. macros

When developing the UI of your application in Aria Templates, you might find yourself wondering:  should I use a sub-template or a macro for the display of a certain panel? This article intends to provide some hints on how to take the right decision, although sometimes it might be a personal choice with no visible …

Function rewrite and closure scope

The best thing about JavaScript is its implementation of functions. Functions are first-class objects. As such they can be constructed at run-time, passed as arguments to other functions, returned from a subroutine, or assigned into variables, objects, and arrays. These features provide the base for functional programming but require a better understanding of dynamic scoping. …

Creating a mobile calendar experience

This post is in fact less about a mobile calendar widget than it is about understanding how some core parts of Aria Templates are split into reusable classes. Aria Templates today is known for its template engine, widgets, JavaScript classes convention, module controller architecture, and some json and ajax utilities. But looking at the API …