netui-data
netui-data:cellRepeater Tag
This tag is a repeating, databound tag that renders its body each cell of a table of the specified dimensions.
<netui-data:cellRepeater
[alternatingCellClass="string_class"]
[cellClass="string_class"]
[columns="integer_columns"]
dataSource="expression_datasource"
[rowClass="string_class"]
[rows="integer_rows"]
[tableClass="string_class"]
[verticalRepeat="boolean_verticalRepeat"] >
... JSP content ...
</netui-data:cellRepeater>
This tag is a repeating, databound tag that renders its body each cell of a table of the specified dimensions.
The tag is bound to a dataset that is specified in the dataSource
attribute. For each item in
the data set, the body of this tag is rendered, and NetUI tags in the body that are databound
can use the container.item
syntax to access the "current" data item in the iteration.
Properties on this data item can be accessed using expressions.
The tag will automatically insert the open and close table, row, and cell tags which will comprise
the table that is rendered. Style attributes may be set using attributes on this tag in order to
cusotmize the tag's final appearance. The dimensions of the table are specified by using at least
one of the attributes columns and rows. If only one is specified, the other will be inferred by
using the size of the given data set. As a result, the entire dataset will be rendered. For example,
if a table should be four columns wide and the data set has twenty items, the resulting table will
have five rows. If the data set is fewer items than the number of cells that should be rendered,
the cells are padded with HTML table cells:
<td> </td>
This will prevent rendering a malformed HTML table. If the number of cells to render is smaller than
the fully specified dimensions of the table, only this number of cells will be rendered. For example,
if the data set is size fifty but the rows
and the columns
attributes are
both seven, only the first forty-nine items in the dataset will be rendered and the fiftieth
will not be shown. The values of the rows
and the columns
can be databound with
an expression; in this case, each value will be converted into an integer. An error will be reported
on the page if this conversion fails.
This tag implements the org.apache.beehive.netui.script.common.IDataAccessProvider interface which provides tags access to the "current"
data item. Properties on the IDataAccessProvider
interface are available through the
"container" binding context, which can be used inside of the body of the CellRepeater. Properties of
the IDataAccessProvider
interface that are available include:
Name | Description |
index | the current index in the iteration; this index is absolute to the dataset |
parent | any IDataAccessProvider parent of this tag |
item | the current data item |
Note: the metadata property of the container
binding context is not supported
on the CellRepeater.
Attributes |
alternatingCellClass |
Required: No | Type:
String |
Supports runtime evaluation / JSP Expression Language: No |
The HTML style class that is rendered on alternating table cells.
The starting cell is alternated for each row, which
results in a checkerboard colored table being displayed. For example, if the
alteranting cell class is "alternatingCellClass", every other table cell
tag is:
<td cell="alternatingCellClass"> |
cellClass |
Required: No | Type:
String |
Supports runtime evaluation / JSP Expression Language: No |
Set the HTML style class that is rendered on each HTML table cell that
is opened by this tag. For example, if the cell class is "cellClass",
each opening table cell tag is:
<td class="cellClass">
|
columns |
Required: No | Type:
String |
Supports runtime evaluation / JSP Expression Language: Yes |
Integer. The number of columns that should be rendered in the HTML table.
If the columns attribute is specified but
the rows attribute is not, the rows attribute will be inferred
using the size of the data set. |
dataSource |
Required: Yes | Type:
String |
Supports runtime evaluation / JSP Expression Language: No |
The dataSource attribute determines both
(1) the source of populating data for the tag and
(2) the object to which the tag submits data.
For example, assume that the Controller file (= JPF file) contains
a Form Bean with the property foo. Then the following <netui:textBox> tag will
(1) draw populating data from the Form Bean's foo property and (2)
submit user defined data to the same property.
<netui:textBox dataSource="actionForm.foo" />
When the tag is used to submit data, the data binding expression must
refer to a Form Bean property.
In cases where the tag is not used to submit data, but is used for
displaying data only, the data
binding expression need not refer to a Form Bean property. For example,
assume that myIterativeData is a member variable on
the Controller file ( = JPF file). The following <netui-data:repeater>
tag draws its data from myIterativeData.
<netui-data:cellRepeater dataSource="pageFlow.myIterativeData"> |
rowClass |
Required: No | Type:
String |
Supports runtime evaluation / JSP Expression Language: No |
Set the HTML style class that is rendered on each HTML table row that
is opened by this tag. For example, if the row class is "rowClass",
each opening table row tag is:
<tr class="rowClass">
|
rows |
Required: No | Type:
String |
Supports runtime evaluation / JSP Expression Language: Yes |
Integer. The number of rows that should be rendered in the HTML table.
If the rows attribute is specified but
the columns attribute is not, the columns attribute will be
inferred using the size of the data set. |
tableClass |
Required: No | Type:
String |
Supports runtime evaluation / JSP Expression Language: No |
The HTML style class that is rendered on the HTML table. For example, if the row class is "tableClass",
each opening table tag is:
<table class="tableClass">
|
verticalRepeat |
Required: No | Type:
String |
Supports runtime evaluation / JSP Expression Language: No |
Boolean. If true the data set is rendered vertically, otherwise it is rendered horizontally. If
the rows are rendered horizontally, the items in the data set are rendered
across each row from top to bottom. Otherwise, they are rendered down each
column from left to right. The default is to render the items horizontally. |
In this example, the <netui-data:cellRepeater> tag creates a table with the number of columns set
given as ${pageFlow.numColumns}
and as many rows as necessary to display all the items in the
pageFlow.itemArray
data set.
<netui-data:cellRepeater dataSource="pageFlow.itemArray" columns="pageFlow.numColumns">
Item: <netui:span value="${container.item}"/>
</netui-data:cellRepeater>
Tag Information |
Tag Class | org.apache.beehive.netui.tags.databinding.cellrepeater.CellRepeater |
TagExtraInfo Class | None |
Body Content | JSP |
Display Name | None |