Tag Reference

Wanghy-TableTag provides the following tags:

Table

Display a set of records in a XHTML table, formatting each record in the list according to the column tags nested inside of this tag.

Example

<table:table firstItemIndex="11" itemCount="18" lastItemIndex="15" pageCount="4"
    pageIndex="3" pagingBanner="both" requestUri="getUsers.do"
    styleClass="table-results" summary="users" var="${users}">
	
    <table:column id="id" property="id" 
        styleClass="centeralign" title="Id" width="10%"/>
	
    <table:column id="username" property="username" sortable="true"
        title="Username" width="30%"/>
	
    <table:column id="fullName" sortable="true" sorted="true" title="Full Name" width="30%">
        ${row.lastName}${', '}${row.firstName}
    </table:column>
	
    <table:column id="role" property="role" sortable="true" title="Role" width="30%"/>
</table:table>

attributes

NameDescriptionTypeRequired
firstItemIndex Index of the first item to display (starting from 1).

The value of this attribute is displayed in the pagination banner.
Integer Only if the value of the attribute pagingBanner is not "none".
itemCount Total number of items to display.

The value of this attribute is displayed in the pagination banner.
Integer Only if the value of the attribute pagingBanner is not "none".
lastItemIndex Index of the last item to display (starting from 1).

The value of this attribute is displayed in the pagination banner.
Integer Only if the value of the attribute pagingBanner is not "none".
pageCount Total number of pages in the set of records.

The value of this attribute is displayed in the pagination banner.
Integer Only if the value of the attribute pagingBanner is not "none".
pageIndex Index of the current page.

The value of this attribute is displayed in the pagination banner.
Integer Only if the value of the attribute pagingBanner is not "none".
pagingBanner Indicates if the banner containing the page navigation should be displayed or not.

Possible values:
  • "top" - displays the banner above the table.
  • "bottom" - displays the banner below the table.
  • "both" - displays the banner above and below the table.
  • "none" (default) - the banner is not displayed.
StringNo
requestUri Name of the URI for the rendered hyperlinks. StringYes
styleClass CSS class to apply to the table. StringYes
summary Summary of the XHTML table. StringNo
var Name of the attribute (in any scope) that contains the array or collection to display. An array or a java.util.CollectionYes

Column

Represents a column in a table. MUST be nested inside of a table tag.

The body of this tag can contain JSP.

Attributes

NameDescriptionTypeRequired
ascendingOrder Sort order of the column.

Possible values:
  • "true" (default) - the column is sorted in ascending order.
  • "false" - the column is sorted in descending order.
String No. Used only if if the value of the attribute sorted is "true".
headerClass CSS style class for the th elements of the generated table. String No
id Unique id of this column. String Yes
property Name of the property of the bean contained in the array or collection specified in the attribute var of the table tag. String No
sortable Indicates if the records can be sorted by this column.

Possible values:
  • "true"
  • "false" (default)
String No
sorted Indicates if the records are sorted by this column.

Possible values:
  • "true"
  • "false" (default)
String No
styleClass CSS class to apply to the column. StringNo
title Title of the column. This value is used as the text of the th elements of the generated table. StringNo
width Width of the column. Can be an absolute value or a percentage. StringNo