org.apache.beehive.netui.tags.databinding.repeater
Class RepeaterHeader

Object
  extended by TagSupport
      extended by BodyTagSupport
          extended by AbstractClassicTag
              extended by RepeaterComponent
                  extended by RepeaterHeader
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, INetuiTag

public class RepeaterHeader
extends RepeaterComponent

Renders the header of a Repeater tag. This header may contain any any HTML markup that can be rendered to a page. In the case of starting a table, ordered list, or unordered list, the HTML elements <table>, <ol>, and <ul> could respectively be rendered inside the body of this tag.

There is no data item present at the time that the <netui-data:repeaterHeader> renders (because the iteration of the <netui-data:repeater> tag has not yet begun), so tags in the body can not reference the ${container...} JSP EL implicit object to access the current item in the data set, though other databinding contexts are available.

The footer tag is rendered exactly once at the beginning of repeater rendering.

For example, the following sample renders the data set as an HTML table. The table has two columns, "index" and "name", and each iteration over the data set is rendered a row of the table. The <netui-data:repeaterHeader> tag renders once, before the iteration has begun. It renders an opening HTML table tag and two header rows for the table.

    <netui-data:repeater dataSource="pageFlow.myDataSet">
        <netui-data:repeaterHeader>
            <table border="1">
                <tr>
                    <td><b>index</b></td>
                    <td><b>name</b></td>
                </tr>
        </netui-data:repeaterHeader>
        <netui-data:repeaterItem>
            <tr>
                <td>
                    <netui:span value="${container.index}" />
                </td>
                <td>
                    <netui:span value="${container.item}" />
                </td>
            </tr>
        </netui-data:repeaterItem>
        <netui-data:repeaterFooter>
            </table>
        </netui-data:repeaterFooter>
    </netui-data:repeater>
 

See Also:
Serialized Form
Example

For example, the following sample renders the data set as an HTML table. The table has two columns, "index" and "name", and each iteration over the data set is rendered a row of the table. The <netui-data:repeaterHeader> tag renders once, before the iteration has begun. It renders an opening HTML table tag and two header rows for the table.

    <netui-data:repeater dataSource="pageFlow.myDataSet">
        <netui-data:repeaterHeader>
            <table border="1">
                <tr>
                    <td><b>index</b></td>
                    <td><b>name</b></td>
                </tr>
        </netui-data:repeaterHeader>
        <netui-data:repeaterItem>
            <tr>
                <td>
                    <netui:span value="${container.index}" />
                </td>
                <td>
                    <netui:span value="${container.item}" />
                </td>
            </tr>
        </netui-data:repeaterItem>
        <netui-data:repeaterFooter>
            </table>
        </netui-data:repeaterFooter>
    </netui-data:repeater>
 


Field Summary
 
Fields inherited from class AbstractClassicTag
DefaultNamingChain, EMPTY_STRING, NETUI_UNIQUE_CNT
 
Fields inherited from class BodyTagSupport
bodyContent
 
Fields inherited from class TagSupport
id, pageContext
 
Fields inherited from interface BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
RepeaterHeader()
           
 
Method Summary
 String getTagName()
          Get the name of this tag.
protected  boolean shouldRender()
           
 
Methods inherited from class RepeaterComponent
doAfterBody, doEndTag, doStartTag, getRepeater, localRelease, renderEndTag, verifyAttributes
 
Methods inherited from class AbstractClassicTag
applyNamingChain, getErrorsReport, getIdForTagId, getNamingChain, getNearestForm, getNextId, getScriptReporter, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, reportAndExit, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Tag
getParent, setPageContext, setParent
 

Constructor Detail

RepeaterHeader

public RepeaterHeader()
Method Detail

getTagName

public String getTagName()
Get the name of this tag. This is used to identify the type of this tag for reporting tag errors.

Specified by:
getTagName in interface INetuiTag
Specified by:
getTagName in class AbstractClassicTag
Returns:
a constant String representing the name of this tag.

shouldRender

protected boolean shouldRender()
Specified by:
shouldRender in class RepeaterComponent