2.17.2: 2011-06-17

Package net.sf.basedb.clients.web.taglib.table

This package is a taglib for generating a fancy table.


Class Summary
Button This tag creates a button on a toolbar.
Cell This tag defines a new cell in a row.
CellValue This tag adds a value to a cell in a row.
ColumnDef This tag defines a column in the table.
Columns This tag is a place-holder for <tbl:header> tags.
Data This tag begins the data section of the table.
Form An alternative layout for tables which contains only one row.
Header This tag defines a header column among the colummns or on a row.
Hidden This tag defines a hidden input element that should be included in the form.
Label This tag creates a label on a toolbar.
Navigator This tag is used to display a navigator for a pageable table of items.
Panel This tag creates a panel in the table.
PresetSelector Special tag for generating a list of saved contexts and other settings.
PropertyFilter Special tag for outputting the filter HTML that a ColumnDef has registered with the Table object.
Row This tag defines a new row in the table.
Rows This tag is a place-holder for <tbl:row> tags.
Table This is the main tag for the table.
TableColumn Column properties class used to define table columns.
Toolbar This tag creates a toolbar in the table.

Package net.sf.basedb.clients.web.taglib.table Description

This package is a taglib for generating a fancy table. The table supports re-ordering and hiding of columns, displays sorting information and allows pageable navigation among other things.


<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>

<tbl:table id="news" clazz="itemlist">
      <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:navigator page="0" rowsperpage="30" totalrows="600" />
   <tbl:data sortby="name" direction="asc" columns="all">
         <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: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: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">&nbsp;</tbl:cell>
            <tbl:cell column="description">Get your copy today.</tbl:cell>
         <!-- more rows -->
The <tbl:table> tag is the main tag for the table. The <tbl:toolbar> tag creates a toolbar which may contain one or more <tbl:button> tags.

The <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 <tbl:data> tag begins the listings section and includes settings for the sort order/direction and which columns should be visible respectively hidden.

<tbl:columns> tag is just a placeholder for <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.

<tbl:rows> tag is just a placeholder for <tbl:row> tags. The <tbl:row> tag is in turn just a placeholder for <tbl:cell> tags. The <tbl:cell> tag is linked to the column ID by the column atribute.


2.17.2: 2011-06-17