O'Reilly logo

ExtGWT Rich Internet Application Cookbook by Odili Charles Opute

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

Doing logic in templates

I personally would not be so thrilled if all that GXT templates offer red was basic string interpolation. Luckily, we can also benefit from some level of conditional processing in the XTemplate class making it possible to vary the rendering or formatting of the intended data depending on the state of things in the data itself.

A simple example of this would be to only show data for customers over a certain age; we can also modify this to use a different formatting style for customers of the requisite age.

Doing logic in templates

How to do it...

Instantiate an XTemplate object with a string representing the desired HTML formatting, and in it use the ...

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