|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTagSupport
BodyTagSupport
AbstractClassicTag
DataSourceTag
CellRepeater
public class CellRepeater
The CellRepeater 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 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 |
container
binding context is not supported
on the CellRepeater.
{pageFlow.numColumns}
and as many
rows as necessary to display all the items in the data set.
<netui-data:cellRepeater dataSource="{pageFlow.itemArray}" columns="{pageFlow.numColumns}" > Item: <netui:label value="{container.item}"/> </netui-data:cellRepeater>
Field Summary |
---|
Fields inherited from class AbstractClassicTag |
---|
DefaultNamingChain, EMPTY_STRING, NETUI_UNIQUE_CNT |
Fields inherited from class BodyTagSupport |
---|
bodyContent |
Fields inherited from class TagSupport |
---|
id, pageContext |
Fields inherited from interface BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
CellRepeater()
|
Method Summary | |
---|---|
void |
addContent(String content)
Add content to the content that is being buffered by this tag. |
int |
doAfterBody()
Continue rendering the body of this tag until the dimensions of the table have been reached or the entire dataset has been rendered. |
void |
doCatch(Throwable t)
|
int |
doEndTag()
Complete rendering the tag. |
void |
doFinally()
|
int |
doStartTag()
Prepare to render the dataset that was specified in the dataSource attribute. |
String |
getContent()
Get the content which should be rendered by this tag. |
int |
getCurrentIndex()
Get the index of the current iteration through the body of this tag. |
Object |
getCurrentItem()
Get the item that is currently being rendered by this repeating tag. |
Object |
getCurrentMetadata()
Get the metadata for the current item. |
IDataAccessProvider |
getProviderParent()
Get the parent IDataAccessProvider for this tag. |
String |
getTagName()
Get the name of this tag. |
protected void |
localRelease()
Reset all of the fields of this tag. |
void |
setAlternatingCellClass(String alternatingCellClass)
Set the HTML style class that is rendered on each HTML table cell that is opened by this tag. |
void |
setCellClass(String cellClass)
Set the HTML style class that is rendered on each HTML table cell that is opened by this tag. |
void |
setColumns(int columns)
Set the number of columns that should be rendered in the table generated by the tag. |
void |
setRowClass(String rowClass)
Set the HTML style class that is rendered on each HTML table row that is opened by this tag. |
void |
setRows(int rows)
Set the number of rows that should be rendered in the table generated by the tag. |
void |
setTableClass(String tableClass)
Set the HTML style class that is rendered on the HTML table that is opened by this tag. |
void |
setVerticalRepeat(boolean verticalRepeat)
This tag can render the items in its dataset horizontally or vertically. |
Methods inherited from class DataSourceTag |
---|
doNaming, evaluateDataSource, getDataSource, getNamingChain, setDataSource |
Methods inherited from class BodyTagSupport |
---|
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
Methods inherited from class TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface IDataAccessProvider |
---|
getDataSource |
Methods inherited from interface Tag |
---|
getParent, setPageContext, setParent |
Constructor Detail |
---|
public CellRepeater()
Method Detail |
---|
public String getTagName()
getTagName
in interface INetuiTag
getTagName
in class AbstractClassicTag
public void addContent(String content)
content
- content that this tag should render.public String getContent()
public void setTableClass(String tableClass)
<table class="tableClass">
tableClass
- the name of a style class in a CSSpublic void setRowClass(String rowClass)
<tr class="rowClass">
rowClass
- the name of a style class in the CSSpublic void setCellClass(String cellClass)
<td class="cellClass">
cellClass
- the name of a style class in a CSSpublic void setAlternatingCellClass(String alternatingCellClass)
<td cell="alternatingCellClass">
alternatingCellClass
- the name of a style class in a CSSpublic void setVerticalRepeat(boolean verticalRepeat)
verticalRepeat
- if set to true
, the dataset is rendered down
each column; otherwise it is rendered across each row, the default.public void setColumns(int columns)
columns
- an integer or an expressionpublic void setRows(int rows)
rows
- an integer or an expression whose value can be
converted into an integer.public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class BodyTagSupport
JspException
- if errors occurred that could not be reported in the pagepublic int doAfterBody()
doAfterBody
in interface IterationTag
doAfterBody
in class BodyTagSupport
public int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class BodyTagSupport
JspException
- if an error occurs that can not be reported on the pagepublic void doFinally()
doFinally
in interface TryCatchFinally
public void doCatch(Throwable t) throws Throwable
doCatch
in interface TryCatchFinally
Throwable
public int getCurrentIndex()
container.index
on an attribute of a databindable NetUI tag that is contained within the
repeating body of this tag. This expression is only valid when the dataset
is being rendered.
getCurrentIndex
in interface IDataAccessProvider
IDataAccessProvider
public Object getCurrentItem()
expression.item
on an attribute of a databindable netUI tag that is contained within
the repeating body of this tag. The expression is only valid when the dataset
is being rendered.
getCurrentItem
in interface IDataAccessProvider
IDataAccessProvider
public Object getCurrentMetadata()
getCurrentMetadata
in interface IDataAccessProvider
null
if no metadata can be
found or metadata is not supported by a IDataAccessProvider implementation
UnsupportedOperationException
- this tag does not support this method from the IDataAccessProvider interfaceIDataAccessProvider
public IDataAccessProvider getProviderParent()
container.container
. Any valid properties of the
parent IDataAccessProvider can be accessed through this expression. This method
will return null if there is no parent IDataAccessProvider
getProviderParent
in interface IDataAccessProvider
IDataAccessProvider
protected void localRelease()
localRelease
in class DataSourceTag
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |