O'Reilly logo

Ext GWT 2.0 Beginner's Guide by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

XTemplate class

A Template is useful, but the XTemplate class is even more useful. An XTemplate is like a Template on steroids. An XTemplate performs the same functions as a Template, but adds a number of other useful capabilities.

As well as creating HTML templates that can contain field values like a normal Template, an XTemplate allows for basic programmatic functions to be defined using more custom template<tpl> tags.

For the following examples, let's first define a ModelData class named Person as follows:

public class Person extends BaseModel {
public Person(String firstName,String lastName) {
set("firstName", firstName);
set("lastName", lastName);
}
}

The for function

First of all, let's look at the for function we used in the previous example ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required