|
|||||||||||
| 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
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. |
java.lang.String |
getName()
Returns the name. |
javax.servlet.jsp.PageContext |
getPageContext()
It's a getter. |
protected TableProperties |
getProperties()
Returns the properties. |
java.lang.String |
getUid()
Returns the unique id used to identify for this table. |
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? |
void |
release()
|
void |
setCaption(java.lang.String string)
Sets the content of the caption. |
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 |
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 |
setProperty(java.lang.String value)
Deprecated. Use expressions in "name" attribute |
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 |
setScope(java.lang.String value)
Deprecated. Use expressions in "name" attribute |
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. |
protected void |
writeExport(ExportView exportView)
Will write the export. |
| Methods inherited from class org.displaytag.tags.HtmlTableTag |
addClass, getCloseTag, getHtmlId, getOpenTag, setAlign, setBackground, setBgcolor, setBorder, setCellpadding, setCellspacing, setClass, setFrame, setHeight, setHspace, setHtmlId, setRules, setStyle, setStyleClass, setSummary, setVspace, setWidth |
| Methods inherited from class org.displaytag.tags.TemplateTag |
evaluateExpression, write, write, 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, 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 |
public 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 contentprotected boolean isEmpty()
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 objectpublic void setProperty(java.lang.String value)
value - property name
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 setScope(java.lang.String value)
value - Stringpublic 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 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 setOffset(int value)
value - Stringpublic void setUid(java.lang.String value)
value - Stringpublic java.lang.String getUid()
public javax.servlet.jsp.PageContext getPageContext()
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
javax.servlet.jsp.JspException - generic exceptionTag.doStartTag()public int doAfterBody()
IterationTag.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
javax.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()
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()public java.lang.String getName()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||