In a simple configuration of a TableInfo component, the columns
property specifies the name and corresponding property of each HTML table column. For example, the following TableInfo
.properties
file configures a TableInfo component to display user profile information.
$class=atg.service.util.TableInfo $scope=session columns=\ Last Name=lastName,\ First Name=firstName,\ City=homeAddress.city,\ Email Address=email
A TableInfo component assumes the existence of a separately managed list of JavaBeans: each columns
expression names a bean property. For example, the previous example of a TableInfo configuration assumes the existence of a separately managed list of user profile objects with the following properties: lastName
, firstName
, homeAddress
.city
, and email
. The TableInfo
component, configured as described, yields an HTML table that looks like this:
LastName | FirstName | City | EmailAddress |
---|---|---|---|
Appleby | Mark | San Diego | mappleby@anywhere.net |
Smith | Paula | San Francisco | paulas@myemail.com |
Jones | Stephanie | San Francisco | founder@jonesnet.com |
Smith | Albert | Los Angeles | albert.smith@mycompany.com |
In general, each HTML table requires one session-scoped instance of TableInfo
.
In most cases, column data is sorted on the property values that are displayed in column cells. Some exceptions can occur—for example, each cell in a table column might contain an HTML anchor tag that links to a news article. In this case, you should sort the column on the article title rather than the table cell contents of each .
When a column’s display property and sort property are different, you can list both on the right side of the column name or specifier, separating the two property names by a semi-colon (;). In the example of the table of news articles, if the display property for a column is named anchorTag
, but you want to sort the column on the title
property, you specify the following:
columns=\ Title=anchorTag ; title,\ Author=author.lastname,\ …