Example:
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> <tbl:table id="news" clazz="itemlist"> <tbl:toolbar> <tbl:button image="new.gif" href="new.jsp" title="New" tooltip="Create a new News entry" /> <tbl:button image="columns.gif" href="columns.jsp" title="Columns" tooltip="Show, hide and re-order columns" /> <tbl:button image="delete.gif" href="delete.jsp" title="Delete" tooltip="Delete the selected items" /> </tbl:toolbar> <tbl:navigator page="0" rowsperpage="30" totalrows="600" /> <tbl:data sortby="name" direction="asc" columns="all"> <tbl:columns> <tbl:column id="name" title="Title" sort="name" show="yes" /> <tbl:column id="startDate" title="Start date" sort="startDate" /> <tbl:column id="newsDate" title="News date" sort="newsDate" /> <tbl:column id="endDate" title="End date" sort="endDate" /> <tbl:column id="description" title="Description" /> </tbl:columns> <tbl:rows> <tbl:row> <tbl:cell column="name">Base 2 server installed</tbl:cell> <tbl:cell column="startDate">2005-04-08</tbl:cell> <tbl:cell column="newsDate">2005-04-08</tbl:cell> <tbl:cell column="endDate">2005-04-15</tbl:cell> <tbl:cell column="description">Welcome to your new BASE server.</tbl:cell> </tbl:row> <tbl:row> <tbl:cell column="name">Base 2 beta released</tbl:cell> <tbl:cell column="startDate">2005-05-31</tbl:cell> <tbl:cell column="newsDate">2005-05-31</tbl:cell> <tbl:cell column="endDate"> </tbl:cell> <tbl:cell column="description">Get your copy today.</tbl:cell> </tbl:row> <!-- more rows --> </tbl:rows> </tbl:data> </tbl:table>The {@link net.sf.basedb.clients.web.taglib.table.Table <tbl:table>} tag is the main tag for the table. The {@link net.sf.basedb.clients.web.taglib.table.Toolbar <tbl:toolbar>} tag creates a toolbar which may contain one or more {@link net.sf.basedb.clients.web.taglib.table.Button <tbl:button>} tags.
The {@link net.sf.basedb.clients.web.taglib.table.Navigator <tbl:navigator>} tag
displays the forward/backward/page number navigation tool. It dynamically
generates the page numbers so it will still work even if there are several hundred pages.
Note! The settings for this tag doesn't affect how many rows are displayed. It is up
to you to make sure that the value passed in the rowsPerPage
attribute
is the same as the number of <tbl:row>
tags.
The {@link net.sf.basedb.clients.web.taglib.table.Data <tbl:data>} tag begins the listings section and includes settings for the sort order/direction and which columns should be visible respectively hidden.
{@link net.sf.basedb.clients.web.taglib.table.Columns <tbl:columns>} tag
is just a placeholder for {@link net.sf.basedb.clients.web.taglib.table.ColumnDef <tbl:columndef>}
tags. The <tbl:columndef>
tag defines a single column. The id
attribute
is important since it is used to link the column to <tbl:cell>
entries
later.
{@link net.sf.basedb.clients.web.taglib.table.Rows <tbl:rows>} tag
is just a placeholder for {@link net.sf.basedb.clients.web.taglib.table.Row <tbl:row>}
tags. The <tbl:row>
tag is in turn just a placeholder for
{@link net.sf.basedb.clients.web.taglib.table.Cell <tbl:cell>} tags.
The <tbl:cell>
tag is linked to the column ID by the column
atribute.
@author Nicklas
@version 2.0