|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTagSupport
BodyTagSupport
AbstractClassicTag
DataSourceTag
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="{pageFlow.customers}"> <li><netui:label 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="{pageFlow.customers}"> <netui-data:repeaterHeader> <ul> </netui-data:repeaterHeader> <netui-data:repeaterItem> <li><netui:label 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="{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 | |
---|---|
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()
|
void |
doCatch(Throwable t)
|
int |
doEndTag()
|
void |
doFinally()
|
int |
doStartTag()
|
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. |
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)
|
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 DataSourceTag |
---|
doNaming, evaluateDataSource, getDataSource, getNamingChain, setDataSource |
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 IDataAccessProvider |
---|
getDataSource |
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 INetuiTag
getTagName
in class AbstractClassicTag
public 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 IDataAccessProvider
IDataAccessProvider
public 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 IDataAccessProvider
IDataAccessProvider
public Object getCurrentMetadata()
getCurrentMetadata
in interface IDataAccessProvider
null
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 interfaceIDataAccessProvider
public 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 IDataAccessProvider
IDataAccessProvider
public 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 parentpublic int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class BodyTagSupport
JspException
- if an error occurs that can not be reported in the pagepublic int doAfterBody()
doAfterBody
in interface IterationTag
doAfterBody
in class BodyTagSupport
public int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class BodyTagSupport
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 TryCatchFinally
Throwable
protected void localRelease()
localRelease
in class DataSourceTag
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |