|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport javax.servlet.jsp.tagext.BodyTagSupport com.bea.wlw.netui.tags.AbstractBaseTag com.bea.wlw.netui.tags.DataSourceTag com.bea.wlw.netui.tags.databinding.cellrepeater.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 DataAccessProvider
interface which provides tags access to the "current" data item. Properties
on the DataAccessProvider
interface are available through the
"container" binding context, which can be used inside of the body of the
CellRepeater. Properties of the DataAccessProvider
interface
that are available include:
Name | Description |
index | the current index in the iteration; this index is absolute to the dataset |
parent | any DataAccessProvider parent of this tag |
item | the current data item |
Note: the metadata property of the container
binding context is not supported
on the CellRepeater.
Attribute Descriptions | |||
---|---|---|---|
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
alternatingCellClass | No | No | No |
The CSS style class to render on every other generated table cell; the cell class
is used if this attribute is not set. The starting cell is alternated for each row, which results in
a checkerboard colored table being displayed. For example, if the alteranting cell class
value is \"alternatingCellClass\" , every other table cell tag in the rendered JSP is:
<td class="alternatingCellClass"> | |||
cellClass | No | No | No |
The CSS style class to render on generated table cells. | |||
columns | No | No | Yes |
A data bindable attribute that specifies how many columns
should appear in the generated table; the value should either be a String
which can be converted into an expression that references an int or Integer.
If the columns attribute was specified but the rows attribute
was not, the rows attribute is inferred using the size of the dataset. | |||
dataSource | No | No | Yes |
An expression that references a dataset that should be
rendered by the cellRepeater. If there was no data in the dataset but the rows
and columns attributes were specified, an empty table of the given dimensions
is rendered. | |||
rowClass | No | No | No |
The CSS style class to render on every generated table row. | |||
rows | No | No | Yes |
A data bindable attribute that specifies how many rows should appear
in the generated table; the value should either be a String which can be converted
into an integer or an expression that references an int or Integer .
If the rows attribute was specified but the columns attribute was not, the
columns attribute is inferred using the size of the dataset. | |||
tableClass | No | No | No |
The CSS style class to render on the generated table. | |||
verticalRepeat | No | No | No |
The boolean that specifies in which direction to repeat the cells, horizontally or vertically. If the rows are rendered horizontally, the items in the dataset 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. |
{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>
[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_databinding/cellRepeater/
The <netui-data:cellRepeater> tag renders
individual cells of an HTML table. The tag
is data bound to a data set specified in the dataSource
attribute. Other <netui...> tags in the body of <netui-data:cellRepeater>
can use the expression {container.item}
to access the current data item in the data set.
The tag will automatically generate the open and close table, row, and cell
tags. Style attributes may
be set using attributes on this tag in order to customize the rendered table's final
appearance. The dimensions of the table are specified with
the attributes columns
and rows
.
If only one dimension 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 the columns
attribute is set to 4 and the data set has 20 items,
the resulting table will have 5 rows. If the data set has 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 50 items
but the rows
and the columns
attributes are both 7,
only the first 49 items in the dataset will be rendered and the 50th
will not be shown. The values of the rows
and the
columns
can take a data binding expression; in this case, each value will be
converted into an integer.
An error will be reported on the page if this conversion
fails.
Note: the metadata
property of the {container...}
binding context is
not supported in the <netui-data:cellRepeater> tag.
Field Summary |
---|
Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag |
---|
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT |
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants |
---|
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.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. |
int |
doEndTag()
Complete rendering the tag. |
int |
doStartTag()
Prepare to render the dataset that was specified in the dataSource attribute. |
String |
getAlternatingCellClass()
Get the HTML style class for every other table cell that is rendered in the HTML table that is rendered by this tag. |
String |
getCellClass()
Get the HTML style class for a table cell that is rendered in the HTML table that is rendered by this tag. |
String |
getColumns()
Get the number of columns that should be rendered in the table generated by this tag. |
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. |
DataAccessProvider |
getProviderParent()
Get the parent DataAccessProvider for this tag. |
String |
getRowClass()
Get the HTML style class for a table row that is rendered in the HTML table that is rendered by this tag. |
String |
getRows()
Get the number of rows that should be rendered in the table generated by this tag. |
String |
getTableClass()
Get the HTML style class for the table that is rendered in the HTML table that is opened by this tag. |
String |
getTagName()
Get the name of this tag. |
boolean |
getVerticalRepeat()
Get the repeat direction. |
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. |
void |
setColumns(String columnsString)
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(String rowsString)
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 com.bea.wlw.netui.tags.DataSourceTag |
---|
addNamingInterceptor, doNaming, evaluateDataSource, getDataSource, qualifyAttribute, removeNamingInterceptor, setDataSource |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.bea.wlw.netui.tags.DataAccessProvider |
---|
getDataSource, setDataSource |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
getParent, setParent |
Constructor Detail |
---|
public CellRepeater()
Method Detail |
---|
public String getTagName()
getTagName
in class AbstractBaseTag
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 CSS<table class="tableClass">
public String getTableClass()
null
if none is setpublic void setRowClass(String rowClass)
<tr class="rowClass">
rowClass
- the name of a style class in the CSS<tr class="rowClass">
public String getRowClass()
null
if none is setpublic void setCellClass(String cellClass)
<td class="cellClass">
cellClass
- the name of a style class in a CSS<td class="cellClass">
public String getCellClass()
null
if none is setpublic void setAlternatingCellClass(String alternatingCellClass)
<td cell="alternatingCellClass">
alternatingCellClass
- the name of a style class in a CSS<td cell="alternatingCellClass">
public String getAlternatingCellClass()
null
if none is setpublic 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 boolean getVerticalRepeat()
true
if the dataset should be rendered down each column. The default
is false
.public void setColumns(String columnsString)
columnsString
- an integer or an expressioncolumns
attribute is specified but
the rows
attribute is not, the rows
attribute will be inferred
using the size of the data set.public String getColumns()
public void setRows(String rowsString)
rowsString
- an integer or an expression whose value can be
converted into an integer.rows
attribute is specified but
the columns
attribute is not, the columns
attribute will be
inferred using the size of the data set.public String getRows()
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if errors occurred that could not be reported in the pagepublic int doAfterBody()
doAfterBody
in interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
in class javax.servlet.jsp.tagext.BodyTagSupport
public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if an error occurs that can not be reported on the pagepublic 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 DataAccessProvider
DataAccessProvider
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 DataAccessProvider
DataAccessProvider
public Object getCurrentMetadata()
getCurrentMetadata
in interface DataAccessProvider
null
if no metadata can be
found or metadata is not supported by a DataAccessProvider implementation
UnsupportedOperationException
- this tag does not support this method from the DataAccessProvider interfaceDataAccessProvider
public DataAccessProvider getProviderParent()
container.container
. Any valid properties of the
parent DataAccessProvider can be accessed through this expression. This method
will return null if there is no parent DataAccessProvider
getProviderParent
in interface DataAccessProvider
DataAccessProvider
protected void localRelease()
localRelease
in class DataSourceTag
|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |