Home » displaytag-1.1.1-src » org » displaytag » tags » [javadoc | source]
org.displaytag.tags
public class: TableTag [javadoc | source]
java.lang.Object
   javax.servlet.jsp.tagext.TagSupport
      javax.servlet.jsp.tagext.BodyTagSupport
         org.displaytag.tags.TemplateTag
            org.displaytag.tags.HtmlTableTag
               org.displaytag.tags.TableTag

All Implemented Interfaces:
    BodyTag, IterationTag, Serializable

Direct Known Subclasses:
    ELTableTag

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
public static final  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. 
public static final  String FILTER_CONTENT_OVERRIDE_BODY    If this variable is found in the request, assume the export filter is enabled. 
protected  Object list    Object (collection, list) on which the table is based. This is not set directly using a tag attribute and can be cleaned. 
protected  Object listAttribute    Object (collection, list) on which the table is based. Set directly using the "list" attribute or evaluated from expression. 
Method from org.displaytag.tags.TableTag Summary:
addCell,   addColumn,   doAfterBody,   doEndTag,   doExport,   doIteration,   doStartTag,   getBaseHref,   getCaptionTag,   getName,   getProperties,   getTableModel,   getTotals,   getUid,   getVarTotals,   initHref,   isEmpty,   isFirstIteration,   isIncludedRow,   isLastIteration,   release,   setCaption,   setCaptionTag,   setDecorator,   setDefaultorder,   setDefaultsort,   setExcludedParams,   setExport,   setFooter,   setLength,   setList,   setName,   setNameString,   setOffset,   setPagesize,   setPartialList,   setProperty,   setRequestURI,   setRequestURIcontext,   setSize,   setSizeObjectName,   setSort,   setUid,   setVarTotals,   setupViewableData,   writeExport
Methods from org.displaytag.tags.HtmlTableTag:
addClass,   getAttributeMap,   release,   setCellpadding,   setCellspacing,   setClass,   setFrame,   setHtmlId,   setRules,   setStyle,   setSummary
Methods from org.displaytag.tags.TemplateTag:
evaluateExpression
Methods from javax.servlet.jsp.tagext.BodyTagSupport:
doAfterBody,   doEndTag,   doInitBody,   doStartTag,   getBodyContent,   getPreviousOut,   release,   setBodyContent
Methods from javax.servlet.jsp.tagext.TagSupport:
doAfterBody,   doEndTag,   doStartTag,   findAncestorWithClass,   getId,   getParent,   getValue,   getValues,   release,   removeValue,   setId,   setPageContext,   setParent,   setValue
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.displaytag.tags.TableTag Detail:
 public  void addCell(Cell cell) 
    Adds a cell to the current row. This method is usually called by a contained ColumnTag
 public  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.
 public int doAfterBody() 
 public int doEndTag() throws JspException 
    Draw the table. This is where everything happens, we figure out what values we are supposed to be showing, we figure out how we are supposed to be showing them, then we draw them.
 protected int doExport() throws JspException 
    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.
 public int doStartTag() throws JspException 
    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. This is the instance used for links, need to be cloned before being modified.
 public CaptionTag getCaptionTag() 
    Obtain the child caption tag.
 protected String getName() 
    Returns the name.
 protected TableProperties getProperties() 
    Returns the properties.
 public TableModel getTableModel() 
    Get the table model for this tag. Sometimes required by local tags that cooperate with DT. USE THIS METHOD WITH EXTREME CAUTION; IT PROVIDES ACCESS TO THE INTERNALS OF DISPLAYTAG, WHICH ARE NOT TO BE CONSIDERED STABLE PUBLIC INTERFACES.
 public Map getTotals() 
    Get the column totals Map. If there is no varTotals defined, there are no totals.
 public String getUid() 
    Returns the unique id used to identify for this table.
 public 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. If false column body is skipped.
 protected boolean isLastIteration() 
    Is this the last iteration?
 public  void release() 
 public  void setCaption(String string) 
    Sets the content of the caption. Called by a nested caption tag.
 public  void setCaptionTag(CaptionTag captionTag) 
    Set the child caption tag.
 public  void setDecorator(String decorator) 
    Setter for the decorator class name.
 public  void setDefaultorder(String value) throws InvalidTagAttributeValueException 
    sets the sorting order for the sorted column.
 public  void setDefaultsort(int value) 
    sets the index of the default sorted column.
 public  void setExcludedParams(String value) 
    Sets the list of parameter which should not be forwarded during sorting or pagination.
 public  void setExport(boolean value) 
    Is export enabled?
 public  void setFooter(String string) 
    Sets the content of the footer. Called by a nested footer tag.
 public  void setLength(int value) 
    sets the number of items to be displayed in the page.
 public  void setList(Object value) 
Deprecated! use - setName() to get the object from the page or request scope instead of setting it directly here

    Used to directly set a list (or any object you can iterate on).
 public  void setName(Object value) 
    Sets the name of the object to use for iteration.
 public  void setNameString(String value) 
    Sets the name of the object to use for iteration. This setter is needed for jsp 1.1 container which doesn't support the String - Object conversion. The bean info class will swith to this setter.
 public  void setOffset(int value) 
    Setter for the list offset attribute.
 public  void setPagesize(int value) 
    sets the number of items that should be displayed for a single page.
 public  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
 public  void setProperty(String propertyName,
    String propertyValue) 
    Called by the setProperty tag to override some default behavior or text String.
 public  void setRequestURI(String value) 
    setter for the "requestURI" attribute. Context path is automatically added to path starting with "/".
 public  void setRequestURIcontext(boolean value) 
    Setter for the "requestURIcontext" attribute.
 public  void setSize(Object size) 
    set the Integer containing the total size of the data displaytag is paginating
 public  void setSizeObjectName(String sizeObjectName) 
    set the name of the Integer in some scope containing the total size of the data to be paginated
 public  void setSort(String value) throws InvalidTagAttributeValueException 
    setter for the "sort" attribute.
 public  void setUid(String value) 
    Sets the unique id used to identify for this table.
 public  void setVarTotals(String varTotalsName) 
    The variable name in which the totals map is stored.
 protected  void setupViewableData() 
    This sets the list of all of the data that will be displayed on the page via the table tag. This might include just a subset of the total data in the list due to to paging being active, or the user asking us to just show a subset, etc...
 protected  void writeExport(ExportView exportView) throws IOException, JspException 
    Will write the export. The default behavior is to write directly to the response. If the ResponseOverrideFilter is configured for this request, will instead write the exported content to a map in the Request object.