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

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

public class RepeaterItem
extends RepeaterComponent

This tag is used to render each item in the data set. The items in the data set are provided by this tag's Repeater parent and are available for databinding using the container databinding context. The current item is referenced using the container.item expression.

The RepeaterItem tag can only be uesd when directly contained by a Repeater tag, and a RepeaterItem is rendered during the Repeater's Repeater.ITEM rendering state.

By default, the RepeaterItem simply renders its body once for each of the items in the Repeater tag's data set.

See Also:
Serialized Form
Example
The following sample renders the data set as an HTML table. The <netui-data:repeaterItem> tag renders a new row in the table for each item in the data set.
    <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:label value="{container.index}" />
                </td>
                <td>
                    <netui:label value="{container.item}" />
                </td>
            </tr>
        </netui-data:repeaterItem>
        <netui-data:repeaterFooter>
            </table>
        </netui-data:repeaterFooter>    
    </netui-data:repeater>

Field Summary
 
Fields inherited from class StructuredBaseTag
EMPTY_STRING
 
Fields inherited from class AbstractClassicTag
DefaultNamingChain, 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
RepeaterItem()
           
 
Method Summary
 int doAfterBody()
          Default implementation of this JSP lifecycle method.
 String getTagName()
          Get the name of this tag.
protected  void localRelease()
          Reset all of the fields of this tag.
 int renderStartTag(int state)
          Render the start of this tag.
 
Methods inherited from class RepeaterComponent
getCurrentRenderState, getRepeater, getValidContainerType, prepare, renderEndTag
 
Methods inherited from class StructuredBaseTag
addContent, doEndTag, doStartTag, getContent, verifyAttributes
 
Methods inherited from class AbstractClassicTag
addTagIdMapping, applyNamingChain, getErrorsReport, getNamingChain, getNextId, getScriptReporter, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, renderAttribute, 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

RepeaterItem

public RepeaterItem()
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.

renderStartTag

public int renderStartTag(int state)
Render the start of this tag. If the repeater render state is Repeater.ITEM, the body is evaluated. Otherwise, the body is skipped.

Specified by:
renderStartTag in class StructuredBaseTag
Returns:
SKIP_BODY unless the repeater render state is Repeater.ITEM, then EVAL_BODY_BUFFERED

doAfterBody

public int doAfterBody()
                throws JspException
Description copied from class: RepeaterComponent
Default implementation of this JSP lifecycle method.

Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class RepeaterComponent
Returns:
SKIP_BODY if the item has completed rendering; EVAL_BODY_BUFFERED if the body should render again.
Throws:
JspException

localRelease

protected void localRelease()
Reset all of the fields of this tag.

Overrides:
localRelease in class RepeaterComponent