RepeaterItem Class

com.bea.wlw.netui.tags.databinding.repeater
RepeaterItem Class

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.

A RepeaterItem has the ability to render different markup for each of the items that it renders. This is possible using the ChoiceMethod and Choice tags. These tags are used inside of the body to select which Choice tag to render and delineate each option that could be chosen.

Related Topics

<netui-data:repeater> Tag Sample
Presenting Complex Data Sets in JSPs (Repeater Tags section)
Repeater
RepeaterHeader
RepeaterFooter
Choice


Hierarchy
Object
  TagSupport
    BodyTagSupport
      AbstractBaseTag
        StructuredBaseTag
          RepeaterComponent
            RepeaterItem
All Implemented Interfaces

BodyTag, IterationTag, Serializable, Tag

Field Summary

public static final int
RENDER
The RepeaterItem lifecycle state that runs through the body in order to render the body of the RepeaterItem.
   
Fields from  com.bea.wlw.netui.tags.databinding.repeater.RepeaterComponent
debug
 
Fields from  com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
EMPTY_STRING
 
Fields from  com.bea.wlw.netui.tags.AbstractBaseTag
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, CLASS, ID, JAVASCRIPT_STATUS, NAME, NETUI_UNIQUE_CNT, ONCLICK, ONDBLCLICK, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, STYLE, TABINDEX
 
Fields from  javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields from  javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 

Constructor Summary

RepeaterItem()

 

Method Summary

public int
doAfterBody()
Render the result of having evalutaed the body.
public Object
getChoiceValue()
Get the value of a nested Choice tag whose value attribute corresponds to the value selected by executing the ChoiceMethod tag.
public int
getRenderState()
Get the current render state of the RepeaterItem.
public String
getTagName()
Get the name of this tag.
public boolean
hasRenderedItem()
Get a boolean that denotes that an item has been rendered for this RepeaterItem.
protected void
localRelease()
Reset all of the fields of this tag.
public int
renderStartTag(int state)
Render the start of this tag.
public void
setChoiceValue(Object choiceValue)
Set the value on a Choice tag whose value attribute matched the result of the result of invoking the ChoiceMethod.
public void
setRenderedItem(boolean renderedItem)
A boolean that denotes that an item has been rendered from the set of Choice tags that may be present in the body of a RepeaterItem tag.
public boolean
shouldRender(Object value, boolean defaultItem)
The decision method that the Choice tags use to determine if the calling Choice tag is the one that hsould render.
public void
stopRendering()
 
Methods from  com.bea.wlw.netui.tags.databinding.repeater.RepeaterComponent
getCurrentRenderState, getRepeater, getValidContainerType, prepare, renderEndTag
 
Methods from  com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
addContent, doEndTag, doStartTag, getContent, getCurrentRenderState, getValidContainerType, localRelease, prepare, renderEndTag, verifyAttributes, verifyStructure
 
Methods from  com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, evaluateAttributeToString, filter, filter, getJavaScriptUtils, getNearestForm, getScriptReporter, getUserLocale, localRelease, registerTagError, release, renderAttribute, rewriteName, write
 
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface javax.servlet.jsp.tagext.BodyTag
doInitBody, setBodyContent
 
Methods from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
 
Methods from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent
 

Field Detail

RENDER

public static final int RENDER
The RepeaterItem lifecycle state that runs through the body in order to render the body of the RepeaterItem.

 

Constructor Detail

RepeaterItem

public RepeaterItem()
 

Method Detail

doAfterBody() Method

public int doAfterBody()
throws JspException
Render the result of having evalutaed the body. Generally, the body is evaluted once, but when ChoiceMethod and Choice tags are present, the body is evaluated twice; once to decide whilch Choice to render and once to actually render the body of that Choice tag.

Overrides
RepeaterComponent.doAfterBody()

Returns

SKIP_BODY if the item has completed rendering; EVAL_BODY_BUFFERED if the body should render again.

Exceptions

JspException

getChoiceValue() Method

public Object getChoiceValue()
Get the value of a nested Choice tag whose value attribute corresponds to the value selected by executing the ChoiceMethod tag. This value is used to determine which Choice tag should render its body.

Returns

the value attribute from a nested Choice tag that matched the return value of the ChoiceMethod.

getRenderState() Method

public int getRenderState()
Get the current render state of the RepeaterItem.

Returns

the RepeaterItem's render state.

getTagName() Method

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

Overrides
AbstractBaseTag.getTagName()

Returns

a constant String representing the name of this tag.

hasRenderedItem() Method

public boolean hasRenderedItem()
Get a boolean that denotes that an item has been rendered for this RepeaterItem. If there are no Choice tags, this will always return false and the body of the RepeaterItem will always render for each item.

Returns

true if the Choice functionality is being used and a Choice has rendered; false otherwise.

localRelease() Method

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

Overrides
RepeaterComponent.localRelease()

renderStartTag(int) Method

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.

Overrides
StructuredBaseTag.renderStartTag(int)

Returns

SKIP_BODY unless the repeater render state is Repeater.ITEM, then EVAL_BODY_BUFFERED

setChoiceValue(Object) Method

public void setChoiceValue(Object choiceValue)
Set the value on a Choice tag whose value attribute matched the result of the result of invoking the ChoiceMethod.

Parameters

choiceValue
the result of executing the ChoiceMethod

setRenderedItem(boolean) Method

public void setRenderedItem(boolean renderedItem)
A boolean that denotes that an item has been rendered from the set of Choice tags that may be present in the body of a RepeaterItem tag.


shouldRender(Object, boolean) Method

public boolean shouldRender(Object value, 
                            boolean defaultItem)
The decision method that the Choice tags use to determine if the calling Choice tag is the one that hsould render. The rules for deciding if a Choice tag should render are as follows:

Parameters

value
the Choice.setValue(String) attribute on the Choice tag that is asking if it should render its body.
defaultItem
the Choice.setDefault(boolean) attribute on the Choice tag that is asking if it should render its body.

Returns

true if the Choice should render; false otherwise.

stopRendering() Method

public void stopRendering()