|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectTagSupport
BodyTagSupport
AbstractClassicTag
Repeater
public class Repeater
The <netui-data:repeater> tag is a markup-generic tag that repeats over a data set. The repeater tag set is used to render data from a data set into a page. The repeater itself does not render any markup. Instead, the markup from its contained tags is rendered to create the content generated by this tag. The tags in the repeater tag set are as follows:
| Tag | Description |
RepeaterHeader | Renders once in the HEADER state. |
RepeaterItem | Renders once in the ITEM state. |
RepeaterFooter | Renders once in the FOOTER state. |
Pad | Used to convert irregular data sets into regular data sets through padding or truncating the output. |
The repeater can render in two modes; the first mode is a simple mode where the body of the repeater is rendered once for each item in the data set. In this case, none of the other tags above are present in the repeater body. For example, the following will render an unordered HTML list of items that are list items which contain the lastName, firstName of the current "customer" in the data set.
<ul>
<netui-data:repeater dataSource="pageInput.customers">
<li><netui:span value="${container.item.lastName}, ${container.item.firstName}"/></li>
</netui-data:repeater>
</ul>
The second mode is a more structured mode of rendering where the tags above are used to delineate iteration boundaries on the body of a <netui-data:repeater> tag. In this case, if one of the above tags is present, any content directly in the body of the repeater is not rendered; rather, the content inside the structured tags of the repeater is rendered.
For example, the following will render the same output as the example
shown above, but it uses the structured tags for rendering the
pageFlow.customers expression:
<netui-data:repeater dataSource="pageInput.customers">
<netui-data:repeaterHeader>
<ul>
</netui-data:repeaterHeader>
<netui-data:repeaterItem>
<li><netui:span value="${container.item.lastName}, ${container.item.firstName}"/></li>
</netui-data:repeaterItem>
<netui-data:repeaterFooter>
</ul>
</netui-data:repeaterFooter>
</netui-data:repeater>
<netui-data:repeater dataSource="pageInput.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: value="${container.item}" />
</td>
</tr>
</netui-data:repeaterItem>
<netui-data:repeaterFooter>
</table>
</netui-data:repeaterFooter>
</netui-data:repeater>| Field Summary | |
|---|---|
static int |
END
A Repeater rendering state that signals the end of repeater rendering. |
static int |
FOOTER
A Repeater rendering state that signals the rendering of the FOOTER. |
static int |
HEADER
A Repeater rendering state that signals the rendering of the HEADER. |
static int |
INIT
A Repeater rendering state that signals the beginning of repeater rendering. |
static int |
ITEM
A Repeater rendering state that signals the rendering of the ITEM. |
| 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 | |
|---|---|
Repeater()
|
|
| Method Summary | |
|---|---|
void |
addContent(String content)
Add content to the content that is being buffered by this tag. |
int |
doAfterBody()
Continue rendering the repeater changing the render state or advancing to a new data item as needed. |
void |
doCatch(Throwable t)
|
int |
doEndTag()
Complete rendering the repeater. |
void |
doFinally()
|
int |
doStartTag()
Start rendering the repeater. |
int |
getCurrentIndex()
Get the index of the current iteration through the body of this tag. |
Object |
getCurrentItem()
Get the item that is currently being rendered by this repeating tag. |
Object |
getCurrentMetadata()
Get the metadata for the current item. |
String |
getDataSource()
Gets the tag's data source (can be an expression). |
protected List |
getNamingChain()
Return an ArrayList which represents a chain of INameInterceptor
objects. |
IDataAccessProvider |
getProviderParent()
Get the parent IDataAccessProvider for this tag. |
int |
getRenderState()
Get the current render state for the repeater. |
String |
getTagName()
Get the name of this tag. |
protected void |
localRelease()
Reset all of the fields of this tag. |
void |
registerChildTag(RepeaterComponent repeaterComponent)
Method used by tags in the repeater tag set to register the presence of a contained tag. |
void |
setDataSource(String dataSource)
Sets the tag's data source (can be an expression). |
void |
setDefaultText(Object defaultText)
Set the text that will be rendered if the dataSource expression references a null object and the defaultText attribute is non-null. |
void |
setIgnoreNulls(boolean ignoreNulls)
Set a boolean that describes whether the repeater should ignore null items encountered while iterating over a data set. |
void |
setPadContext(PadContext padContext)
|
| 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 |
| Field Detail |
|---|
public static final int INIT
public static final int HEADER
public static final int ITEM
public static final int FOOTER
public static final int END
| Constructor Detail |
|---|
public Repeater()
| Method Detail |
|---|
public String getTagName()
getTagName in interface INetuiTaggetTagName in class AbstractClassicTagpublic void setIgnoreNulls(boolean ignoreNulls)
ignoreNulls - whether or not to ignore nullspublic void setPadContext(PadContext padContext)
padContext - public void setDefaultText(Object defaultText)
defaultText - the default textpublic int getCurrentIndex()
container.index
on an attribute of a databindable NetUI tag that is contained within the
repeating body of this tag. This expression is only valid when the dataset
is being rendered.
getCurrentIndex in interface IDataAccessProviderIDataAccessProviderpublic Object getCurrentItem()
expression.item
on an attribute of a databindable NetUI tag that is contained within
the repeating body of this tag. The expression is only valid when the dataset
is being rendered.
getCurrentItem in interface IDataAccessProviderIDataAccessProviderpublic Object getCurrentMetadata()
getCurrentMetadata in interface IDataAccessProvidernull if no metadata can be
found or metadata is not supported by a IDataAccessProvider implementation
UnsupportedOperationException - this tag does not support this method from the IDataAccessProvider interfaceIDataAccessProviderpublic IDataAccessProvider getProviderParent()
container.container. Any valid properties of the
parent IDataAccessProvider can be accessed through this expression. This method
will return null if there is no parent IDataAccessProvider
getProviderParent in interface IDataAccessProviderIDataAccessProviderpublic int getRenderState()
INIT, HEADER, ITEM,FOOTER, or END.public void addContent(String content)
content - content that this tag should render.public void registerChildTag(RepeaterComponent repeaterComponent)
repeaterComponent - RepeaterComponent to register with the Repeater parent
public int doStartTag()
throws JspException
doStartTag in interface TagdoStartTag in class BodyTagSupportTag.SKIP_BODY if an error occurs; BodyTag.EVAL_BODY_BUFFERED otherwise
JspException - if an error occurs that can not be reported in the pagepublic int doAfterBody()
Continue rendering the repeater changing the render state or advancing to a new data item as needed.
doAfterBody in interface IterationTagdoAfterBody in class BodyTagSupportTag.SKIP_BODY if an error occurs or the data set has been rendered; IterationTag.EVAL_BODY_AGAIN otherwise
public int doEndTag()
throws JspException
doEndTag in interface TagdoEndTag in class BodyTagSupportTag.EVAL_PAGE
JspException - if an error occurs that can not be reported in the pagepublic void doFinally()
doFinally in interface TryCatchFinally
public void doCatch(Throwable t)
throws Throwable
doCatch in interface TryCatchFinallyThrowableprotected void localRelease()
localRelease in class AbstractClassicTagprotected List getNamingChain()
ArrayList which represents a chain of INameInterceptor
objects. This method by default returns null and should be overridden
by objects that support naming.
getNamingChain in class AbstractClassicTagArrayList that will contain INameInterceptor objects.public void setDataSource(String dataSource)
dataSource - - the data sourcepublic String getDataSource()
getDataSource in interface IDataAccessProvider
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||