Display *: Tag Library
Tag column


Displays a property of a row object inside a table. MUST be nested inside of a Table tag. The value displayed will be the results of a decorator (if any); else the property named by the 'property' attribute; or if the 'property' attribute is null, then the results of evaluating the JSP body of the tag.


Tag Information
Tag Classorg.displaytag.tags.ColumnTag
TagExtraInfo ClassNone
Body ContentJSP
Display Namecolumn

Attributes
NameRequiredRequest-timeTypeDescription
propertyfalsetruejava.lang.Stringname of the property in the bean specified in the parent table tag (via the "name" attribute) mapped to this column
sortPropertyfalsetruejava.lang.Stringname of the property in the bean specified in the parent table tag (via the "name" attribute) which will be used to sort values in the column. This can be used when the column body is filled or a decorator is used and column should sort on undeorated values.
titlefalsetruejava.lang.Stringtitle of the column (text for the th cell)
comparatorfalsetruejava.lang.StringThe classname of comparator to use when sorting this column, or the comparator itself. Defaults to the DefaultComparator.
titleKeyfalsetruejava.lang.StringResource key used to lookup the title value. Only works if "title" is not defined. Works together with a configured I18nResourceProvider, specified via the displaytag.properties file. By default, if JSTL is available, the JSTL provider is used, which makes this attribute work the same as fmt:message's key property.
nullsfalsetruebooleanBy default, null values don't appear in the list. By setting 'nulls' to 'true', then null values will appear as "null" in the list (mostly useful for debugging). Defaults to 'false'.
totalfalsetruebooleanIf true, will total the contents of this column. This value is available via the Map named in varTotals for the table. Column values need to Numbers.
sortablefalsetruebooleanSet to 'true' to make the column sortable. Defaults to 'false'.
defaultorderfalsetruejava.lang.StringThe default sort order for this column. Valid values are "ascending" (default) or "descending"
autolinkfalsetruebooleanAutomatically hyperlink URLs and email addresses that appear in the column. Defaults to 'false'.
formatfalsetruejava.lang.StringA MessageFormat patter that will be used to decorate objects in the column. Can be used as a "shortcut" for simple column decorations. @since 1.1
escapeXmlfalsetruebooleanSet it to true to escape special characters in html and xml output. Defaults to 'false'. @since 1.1
mediafalsetruejava.lang.StringUse this attribute to keep a column from being output during an export. The column will only render for the named media type(s) - it won't be added to the table if the current request media is not supported. Can be any space separated combination of 'html', 'csv', 'xml', 'all', or 'excel'. Defaults to 'all'. See the export page in the example webapp for more details.
hreffalsetruejava.lang.StringThe base URL used to construct the dynamic link. If this attribute is provided, then the data that is shown for this column is wrapped inside a tag with the url provided through this attribute. Typically you would use this attribute along with one of the struts-like param attributes (param*) to create a dynamic link so that each row creates a different URL based on the data that is being viewed. An empty href value will generate a link to the current page, preserving parameters just like for paging links.
urlfalsetruejava.lang.StringThe base URL used to construct the dynamic link. This attribute has the same functionality as the href attribute, but it pre-pends the contextPath.
paramIdfalsetruejava.lang.StringThe name of the request parameter that will be dynamically added to the generated href URL. The corresponding value is defined by the paramProperty and (optional) paramName attributes, optionally scoped by the paramScope attribute.
paramNamefalsetruejava.lang.StringThe name of a JSP bean that is a String containing the value for the request parameter named by paramId (if paramProperty is not specified), or a JSP bean whose property getter is called to return a String (if paramProperty is specified). The JSP bean is constrained to the bean scope specified by the paramScope property, if it is specified. If paramName is omitted, then it is assumed that the current object being iterated on is the target bean.
paramPropertyfalsetruejava.lang.StringThe name of a property of the current object being iterated on, whose return value will be used as the value of the parameter (named by the paramId attribute) that will be dynamically added to this href URL. If paramName is also specified the property will not be fetched from the object being iterated on, but from the bean specified by paramName. The support of paramProperty in conjunction with paramName will be probably removed in future: use paramProperty only if you need a property in the iterated object, elsewhere use only paramName (you can select a property using an expression name.property).
paramScopefalsetruejava.lang.String@deprecated - use Expressions in paramName. The scope within which to search for the bean specified by the paramName attribute. If not specified, all scopes are searched. If paramName is not provided, then the current object being iterated on is assumed to be the target bean.
maxLengthfalsetrueintIf this attribute is provided, then the column's displayed is limited to this number of characters. An elipse (...) is appended to the end if this column is linked, and the user can mouseover the elipse to get the full text. Be careful on using this attribute for String which can contain html tags or entities, or together with the autolink attribute turned on: displaytag will do its best trying to avoid leaving unclosed tags or broken entities in the output, but a complex or bad input could lead to unattended results.
maxWordsfalsetrueintIf this attribute is provided, then the column's displayed is limited to this number of words. An elipse (...) is appended to the end if this column is linked, and the user can mouseover the elipse to get the full text. Be careful on using this attribute for String which can contain html tags or entities, or together with the autolink attribute turned on: displaytag will do its best trying to avoid leaving unclosed tags or broken entities in the output, but a complex or bad input could lead to unattended results.
classfalsetruejava.lang.Stringhtml pass through attribute; use this instead of directly coding presentational atttributes.
headerClassfalsetruejava.lang.String"class" html attribute added only for header cells.
stylefalsetruejava.lang.Stringhtml pass through attribute.
groupfalsetrueintThe grouping level (starting at 1 and incrementing) of this column (indicates if successive contain the same values, then they should not be displayed). The level indicates that if a lower level no longer matches, then the matching for this higher level should start over as well. If this attribute is not included, then no grouping is performed.
decoratorfalsetruejava.lang.StringWhitespace separated list of column decorators to apply to the current column. A table decorator name can be the name of an object in page, request, session or application scope or a fully qualified class name of a class implementing the org.displaytag.decorator.DisplaytagColumnDecorator interface. If a decorator is specified for the entire table, then this decorator will decorate that decorator.
sortNamefalsetruejava.lang.StringUsed with sort="external", the name that should be given to the server to sort this column. IE if sortName="buzz", then the href for this column to sort will have a parameter d-(encodedId)-s=buzz. If sortName is ommitted the value for the sort param will default to the column number.
headerScopefalsetruejava.lang.String"scope" html attribute added only for header cells.
scopefalsetruejava.lang.String"scope" html attribute.
valuefalsetruejava.lang.ObjectStatic value to be used for the column. It has the same meaning of setting a value in the tag body, but values set using this attribute will not be coerced to Strings. You may need to use the value attribute instead of a scriptlet in the tag body if you need to calculate totals on numeric values.

Variables
No Variables Defined.


Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.