|
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.grid.Grid
public class Grid
A <netui-data:grid...> tag is the containing tag of a tag set that renders regular data with the ability to page, sort, and filter the data set. A grid renders a table that represents the data in a data set. In addition, metadata about the data set may be used to parameterize aspects of grid rendering.
The grid uses two objects to encapsulate its attributes and the data set that is rendered. These items are:
The former is used to encapsulate the attributes set on the Grid tag, while the latter is used to provide a consistent interface over different types of data sets. This enables the tags to interact with the same interface regardless of the type of data being displayed.
A grid renders a table in order to display the data. This table consists of three parts:
These parts are structured in a grid as follows:
column 1: header | column 2: header | column 3: header |
column 1: data cell | column 2: data cell | column 3: data cell |
column 1: data cell | column 2: data cell | column 3: data cell |
column 1: data cell | column 2: data cell | column 3: data cell |
column 1: footer | column 2: footer | column 3: footer |
The grid is rendered either automatically or by nesting tags of type
GridColumn
tags inside of a Columns
tag. The GridColumn tags are:
If the grid is automatically rendered, all parts of the table above are rendered from the data set.
The resulting Grid is not sortable or filterable. If the grid is rendered using its GridColumn,
each column renders a single cell for each row. Regardless of how a grid is rendered, a row is
rendered for each item in the data set, unless a
Pager
tag is used to set the page size.
The types that are supported for rendering in the grid are javax.sql.RowSet
.
Any other types that are passed to the grid via an expression in the dataSource attribute will
be illegal and an error will be reported in the JSP page.
Attribute Descriptions | |||
---|---|---|---|
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
autoRender | No | No | No |
A boolean specifying whether the grid should automatically render or should render using its body. | |||
dataSource | Yes | No | Yes |
An expression that references a data object which should be rendered by the grid.
Only data sets of type javax.sql.RowSet are supported.
| |||
name | Yes | No | Yes |
A unique identifier for this grid. |
Columns
,
Serialized FormThis sample shows a <netui-data:grid> tag that writes out two
AnchorColumn
and one BasicColumn
.
<netui-data:grid dataSource="{pageFlow.allRows}" name="{pageFlow.gridName}"> <netui-data:gridStyle styleClassPrefix="gridStyle"/> <netui-data:pager renderInHeader="true" action="pageAction" renderInFooter="true"/> <netui-data:columns filterAction="begin" sortAction="begin"> <netui-data:anchorColumn action="detailsItems" addRowId="true" title="Details"/> <netui-data:anchorColumn action="updateItems" addRowId="true" title="Edit"/> <netui-data:basicColumn filterable="true" title="Itemnumber" sortable="true" name="itemnumber"/> </netui-data:columns> </netui-data:grid>
The rendered table consists of three parts:
- header
- data rows
- footer
These parts are structured in a grid as follows:
column 1: header | column 2: header | column 3: header |
column 1: data cell | column 2: data cell | column 3: data cell |
column 1: data cell | column 2: data cell | column 3: data cell |
column 1: data cell | column 2: data cell | column 3: data cell |
column 1: footer | column 2: footer | column 3: footer |
The grid is rendered either automatically or by nesting the following tags
inside of a Columns
tag:
If the grid is automatically rendered, the resulting HTML table
is not sortable or filterable. Regardless of how a grid is rendered, a row is
rendered for each item in the data set, unless a
Pager
tag is used to set the page size.
javax.sql.RowSet is the only type supported for rendering by the <netui-data:grid>. Any other types that are passed to the grid are illegal and an error will be reported in the JSP page.
Field Summary | |
---|---|
static int |
END
A Grid rendering state that runs after the FOOT_PAGER state has completed. |
static int |
FOOT_PAGER
A Grid rendering state that runs after the grid to give the optional Pager the opportunity
to render after the grid renders. |
static int |
FOOTER
A Grid rendering state that runs when the Grid's columns are rendering their footer cells. |
static int |
HEAD_PAGER
A Grid rendering state that runs to give the optional Pager
the opportunity to render before the grid renders. |
static int |
HEADER
A Grid rendering state that runs when the Grid's columns are rendering their header cell. |
static int |
INIT
A Grid rendering state that runs on the Grid's first pass through its body. |
static int |
ROWS
A Grid rendering state that runs when the Grid's columns are rendering their data cells. |
static int |
START
A Grid rendering state which signals that an error has occurred during rendering. |
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.ErrorReporter |
---|
CONTAINER_ERRORS |
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, 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 | |
---|---|
Grid()
|
Method Summary | |
---|---|
void |
addContent(String content)
Add content to the content that is being buffered by this tag. |
void |
addError(AbstractPageError ape)
|
int |
doAfterBody()
Conginue rendering the grid until it has passed through all of its rendering states. |
int |
doEndTag()
Render the content for the grid. |
int |
doStartTag()
Start the rendering of the grid. |
boolean |
getAutoRender()
Get a boolean that tells whether a grid will render automatically. |
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. |
DataContext |
getDataContext()
|
String |
getDataSource()
Gets the tag's data source (can be an expression). |
protected String |
getErrorsReport()
|
GridContext |
getGridContext()
|
String |
getImageRoot()
|
String |
getName()
Get the name of a grid. |
DataAccessProvider |
getProviderParent()
Get the parent DataAccessProvider for this tag. |
int |
getRenderState()
Get the current render state for the Grid. |
String |
getTagName()
Get the name of this tag. |
protected boolean |
hasErrors()
|
boolean |
isReporting()
This boolean indicates if an ErrorReporter is reporting errors or not. |
protected void |
localRelease()
Reset all of the fields of this tag. |
ArrayList |
returnErrors()
Return an ArrayList of the errors |
void |
setAutoRender(boolean autoRender)
Set a boolean that tells a Grid to render it self automatically. |
void |
setDataSource(String dataSource)
Set the dataSource attribute. |
void |
setGridStyle(GridStyleContext gridStyle)
Set the GridStyleContext that
encapsulates the style information for a Grid tag. |
void |
setImageRoot(String imageRoot)
|
void |
setName(String name)
Set the name of a grid. |
Methods inherited from class com.bea.wlw.netui.tags.DataSourceTag |
---|
addNamingInterceptor, doNaming, evaluateDataSource, qualifyAttribute, removeNamingInterceptor |
Methods inherited from class com.bea.wlw.netui.tags.AbstractBaseTag |
---|
addTagIdMapping, containsExpression, evaluateAttributeToString, evaluateExpression, filter, filter, formatErrorString, formatString, getAttribute, getExpressionEvaluator, getJavaScriptUtils, getNearestForm, getNextId, getQualifiedBundleName, getScriptReporter, getUserLocale, isExpression, prepForRendering, registerAttribute, registerError, registerTagError, release, removeAttribute, renderAttribute, renderAttributes, reportErrors, rewriteName, setPageContext, updateExpression, write |
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 javax.servlet.jsp.tagext.Tag |
---|
getParent, setParent |
Field Detail |
---|
public static final int START
public static final int INIT
public static final int HEAD_PAGER
Pager
the opportunity to render before the grid renders. This state executes exactly once.
public static final int HEADER
container
context are invalid.
This state executes exactly once.
public static final int ROWS
public static final int FOOTER
container
context are invalid. This state executes
exactly once.
public static final int FOOT_PAGER
Pager
the opportunity
to render after the grid renders. This state executes exactly once.
public static final int END
FOOT_PAGER
state has completed.
This state signals that the Grid has completed rendering.
Constructor Detail |
---|
public Grid()
Method Detail |
---|
public void setImageRoot(String imageRoot)
public String getImageRoot()
public String getTagName()
getTagName
in class AbstractBaseTag
public final DataContext getDataContext()
DataContext
that is associated with a Grid tagpublic final GridContext getGridContext()
GridContext
that is associated with a Grid tagpublic final void addContent(String content)
content
- content that this tag should render.public final String getContent()
public void setName(String name)
name
- the String name of the grid or an expression that references a String name of the gridpublic String getName()
public void setAutoRender(boolean autoRender)
autoRender
- a boolean signifying whether a grid should automatically render.
If true
auto render; otherwise render using the tags in the grid's
body.public boolean getAutoRender()
true
if the grid should automatically render; false
otherwise.public int getRenderState()
START
, INIT
, HEAD_PAGER
, HEADER
, ROWS
,
FOOTER
, FOOT_PAGER
, or END
public void setGridStyle(GridStyleContext gridStyle)
GridStyleContext
that
encapsulates the style information for a Grid tag. A GridStyleContext
is
created by the GridStyle
tag in order to
parameterize the Grid with style information. The context is set here because it will
be reused in many states during a Grid tag's lifecycle, and the specific GridStyle
tag may not be valid when the style information is needed.
public int doStartTag() throws javax.servlet.jsp.JspException
DataContext
object. The body is rendered the first time in the INIT state.
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- thrown when an error occurs during grid rendering that can not
be reported in the page.public int doAfterBody()
addContent(java.lang.String)
method. Once the END state is
reached, the body is skipped. Each of these stages makes a pass through
the tag's body once except for the ROWS state, which is executed once for
each item in the dataset.
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 has occurred that can not be reported in the pageprotected void localRelease()
localRelease
in class DataSourceTag
public void addError(AbstractPageError ape)
addError
in interface ErrorReporter
protected boolean hasErrors()
hasErrors
in class AbstractBaseTag
public boolean isReporting()
ErrorReporter
isReporting
in interface ErrorReporter
public ArrayList returnErrors()
ErrorReporter
returnErrors
in interface ErrorReporter
ArrayList
of all errors.protected String getErrorsReport()
getErrorsReport
in class AbstractBaseTag
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 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 String getDataSource()
DataSourceTag
getDataSource
in interface DataAccessProvider
getDataSource
in class DataSourceTag
public void setDataSource(String dataSource)
setDataSource
in interface DataAccessProvider
setDataSource
in class DataSourceTag
dataSource
- an expression that references a data objectpublic 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
|
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 |