|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.displaytag.tags.TemplateTag
org.displaytag.tags.HtmlTableTag
org.displaytag.tags.TableTag
public class TableTag
This tag takes a list of objects and creates a table to display those objects. With the help of column tags, you simply provide the name of properties (get Methods) that are called against the objects in your list that gets displayed. This tag works very much like the struts iterator tag, most of the attributes have the same name and functionality as the struts tag.
| Field Summary | |
|---|---|
static java.lang.String |
FILTER_CONTENT_OVERRIDE_BODY
If this variable is found in the request, assume the export filter is enabled. |
protected java.lang.Object |
list
Object (collection, list) on which the table is based. |
protected java.lang.Object |
listAttribute
Object (collection, list) on which the table is based. |
static java.lang.String |
PAGE_ATTRIBUTE_MEDIA
name of the attribute added to page scope when exporting, containing an MediaTypeEnum this can be used in column content to detect the output type and to return different data when exporting. |
| 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 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 | |
|---|---|
TableTag()
|
|
| Method Summary | |
|---|---|
void |
addCell(Cell cell)
Adds a cell to the current row. |
void |
addColumn(HeaderCell column)
Called by interior column tags to help this tag figure out how it is supposed to display the information in the List it is supposed to display. |
int |
doAfterBody()
|
int |
doEndTag()
Draw the table. |
protected int |
doExport()
Called when data are not displayed in a html page but should be exported. |
protected int |
doIteration()
Utility method that is used by both doStartTag() and doAfterBody() to perform an iteration. |
int |
doStartTag()
When the tag starts, we just initialize some of our variables, and do a little bit of error checking to make sure that the user is not trying to give us parameters that we don't expect. |
protected Href |
getBaseHref()
Returns the base href with parameters. |
CaptionTag |
getCaptionTag()
Obtain the child caption tag. |
protected java.lang.String |
getName()
Returns the name. |
protected TableProperties |
getProperties()
Returns the properties. |
TableModel |
getTableModel()
Get the table model for this tag. |
java.util.Map |
getTotals()
Get the column totals Map. |
java.lang.String |
getUid()
Returns the unique id used to identify for this table. |
java.lang.String |
getVarTotals()
Get the name that the totals should be stored under. |
protected void |
initHref(RequestHelper requestHelper)
init the href object used to generate all the links for pagination, sorting, exporting. |
protected boolean |
isEmpty()
Is the current row empty? |
protected boolean |
isFirstIteration()
Is this the first iteration? |
protected boolean |
isIncludedRow()
Is the current row included in the "to-be-evaluated" range? Called by nested ColumnTags. |
protected boolean |
isLastIteration()
Is this the last iteration? |
void |
release()
|
void |
setCaption(java.lang.String string)
Sets the content of the caption. |
void |
setCaptionTag(CaptionTag captionTag)
Set the child caption tag. |
void |
setClearStatus(boolean clearStatus)
Setter for clearStatus. |
void |
setDecorator(java.lang.String decorator)
Setter for the decorator class name. |
void |
setDefaultorder(java.lang.String value)
sets the sorting order for the sorted column. |
void |
setDefaultsort(int value)
sets the index of the default sorted column. |
void |
setExcludedParams(java.lang.String value)
Sets the list of parameter which should not be forwarded during sorting or pagination. |
void |
setExport(boolean value)
Is export enabled? |
void |
setFooter(java.lang.String string)
Sets the content of the footer. |
void |
setForm(java.lang.String form)
Setter for form. |
void |
setKeepStatus(boolean keepStatus)
Preserve the current page and sort across session? |
void |
setLength(int value)
sets the number of items to be displayed in the page. |
void |
setList(java.lang.Object value)
Deprecated. use setName() to get the object from the page or request scope instead of setting it directly here |
void |
setName(java.lang.Object value)
Sets the name of the object to use for iteration. |
void |
setNameString(java.lang.String value)
Sets the name of the object to use for iteration. |
void |
setOffset(int value)
Setter for the list offset attribute. |
void |
setPagesize(int value)
sets the number of items that should be displayed for a single page. |
void |
setPartialList(boolean partialList)
tells display tag that the values contained in the list are the viewable data only, there may be more results not given to displaytag |
void |
setProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Called by the setProperty tag to override some default behavior or text String. |
void |
setRequestURI(java.lang.String value)
setter for the "requestURI" attribute. |
void |
setRequestURIcontext(boolean value)
Setter for the "requestURIcontext" attribute. |
void |
setSize(java.lang.Object size)
set the Integer containing the total size of the data displaytag is paginating |
void |
setSizeObjectName(java.lang.String sizeObjectName)
set the name of the Integer in some scope containing the total size of the data to be paginated |
void |
setSort(java.lang.String value)
setter for the "sort" attribute. |
void |
setUid(java.lang.String value)
Sets the unique id used to identify for this table. |
protected void |
setupViewableData()
This sets the list of all of the data that will be displayed on the page via the table tag. |
void |
setVarTotals(java.lang.String varTotalsName)
The variable name in which the totals map is stored. |
protected void |
writeExport(ExportView exportView)
Will write the export. |
protected void |
writeHTMLData()
Uses HtmlTableWriter to write table called when data have to be displayed in a html page. |
| Methods inherited from class org.displaytag.tags.HtmlTableTag |
|---|
addClass, getAttributeMap, setCellpadding, setCellspacing, setClass, setFrame, setHtmlId, setRules, setStyle, setSummary |
| Methods inherited from class org.displaytag.tags.TemplateTag |
|---|
evaluateExpression |
| 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, setPageContext, 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, setPageContext, setParent |
| Field Detail |
|---|
public static final java.lang.String PAGE_ATTRIBUTE_MEDIA
public static final java.lang.String FILTER_CONTENT_OVERRIDE_BODY
protected java.lang.Object list
protected java.lang.Object listAttribute
| Constructor Detail |
|---|
public TableTag()
| Method Detail |
|---|
protected boolean isLastIteration()
true if this is the last iterationpublic void setExcludedParams(java.lang.String value)
value - whitespace separated list of parameters which should not be included (* matches all parameters)public void setFooter(java.lang.String string)
string - footer contentpublic void setCaption(java.lang.String string)
string - caption contentpublic void setCaptionTag(CaptionTag captionTag)
captionTag - Child caption tagpublic CaptionTag getCaptionTag()
protected boolean isEmpty()
public void setKeepStatus(boolean keepStatus)
keepStatus - true to preserve paging and sortingpublic void setClearStatus(boolean clearStatus)
clearStatus.
clearStatus - The clearStatus to set.public void setForm(java.lang.String form)
form.
post - The form to set.public void setSize(java.lang.Object size)
size - Integer containing the total size of the datapublic void setSizeObjectName(java.lang.String sizeObjectName)
sizeObjectName - name of the Integer containing the total size of the data to be paginated
public void setSort(java.lang.String value)
throws InvalidTagAttributeValueException
value - "page" (sort a single page) or "list" (sort the full list)
InvalidTagAttributeValueException - if value is not "page" or "list"public void setRequestURI(java.lang.String value)
value - base URI for creating linkspublic void setRequestURIcontext(boolean value)
value - base URI for creating linkspublic void setList(java.lang.Object value)
value - Objectpublic void setName(java.lang.Object value)
value - name of the object to use for iteration (can contain expression). It also supports direct setting of
a list, for jsp 2.0 containers where users can set up a data source here using EL expressions.public void setNameString(java.lang.String value)
value - name of the object
public void setDefaultorder(java.lang.String value)
throws InvalidTagAttributeValueException
value - "ascending" or "descending"
InvalidTagAttributeValueException - if value is not one of "ascending" or "descending"public void setDecorator(java.lang.String decorator)
decorator - fully qualified name of the table decorator to usepublic void setExport(boolean value)
value - true if export should be enabledpublic void setVarTotals(java.lang.String varTotalsName)
varTotalsName - the valuepublic java.lang.String getVarTotals()
public void setLength(int value)
value - number of items to display in a pagepublic void setDefaultsort(int value)
value - index of the column to sortpublic void setPagesize(int value)
value - number of items that should be displayed for a single pagepublic void setPartialList(boolean partialList)
partialList - boolean value telling us there may be more data not given to displaytagpublic void setOffset(int value)
value - Stringpublic void setUid(java.lang.String value)
value - Stringpublic java.lang.String getUid()
protected TableProperties getProperties()
protected Href getBaseHref()
public void addColumn(HeaderCell column)
column - an internal tag describing a column in this tableviewpublic void addCell(Cell cell)
cell - Cell to add to the current rowprotected boolean isFirstIteration()
true if this is the first iteration
public int doStartTag()
throws javax.servlet.jsp.JspException
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspException - generic exceptionTag.doStartTag()public int doAfterBody()
doAfterBody in interface javax.servlet.jsp.tagext.IterationTagdoAfterBody in class javax.servlet.jsp.tagext.BodyTagSupportIterationTag.doAfterBody()protected int doIteration()
int either EVAL_BODY_TAG or SKIP_BODY depending on whether another iteration is desired.protected boolean isIncludedRow()
false
column body is skipped.
true if the current row must be evaluated because is included in output or because is
included in sorting.protected void initHref(RequestHelper requestHelper)
requestHelper - request helper used to extract the base Href
public int doEndTag()
throws javax.servlet.jsp.JspException
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspException - generic exceptionTag.doEndTag()
protected int doExport()
throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException - generic exception
protected void writeExport(ExportView exportView)
throws java.io.IOException,
javax.servlet.jsp.JspException
exportView - export view
javax.servlet.jsp.JspException - for problem in clearing the response or for invalid export views
java.io.IOException - exception thrown when writing content to the responseprotected void setupViewableData()
protected void writeHTMLData()
throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException - generic exceptionpublic java.util.Map getTotals()
public TableModel getTableModel()
public void setProperty(java.lang.String propertyName,
java.lang.String propertyValue)
propertyName - String property namepropertyValue - String property valuepublic void release()
release in interface javax.servlet.jsp.tagext.Tagrelease in class HtmlTableTagTag.release()protected java.lang.String getName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||