|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport javax.servlet.jsp.tagext.BodyTagSupport com.bea.wlw.netui.tags.AbstractBaseTag com.bea.wlw.netui.tags.DataSourceTag com.bea.wlw.netui.tags.databinding.repeater.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. |
Choice | Used to render different UI for a particular data item bsaed on the result of calling a "decision" method with the ChoiceMethod tag. This is allowed only within the RepeaterItem tag. |
ChoiceMethod | Used to define the choices when rendering an item with a RepeaterItem tag. This is allowed only within the RepeaterItem tag. |
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>
Attribute Descriptions | |||
---|---|---|---|
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
defaultText | No | No | No |
The text that is rendered if the data set is null or contains zero items. | |||
ignoreNulls | No | No | No |
A boolean to set if rendering a sparse data set that can contain nulls which should be ignored. |
RepeaterHeader
,
RepeaterItem
,
RepeaterFooter
,
Serialized Form<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>
The <netui-data:repeater> tag iterates over a data set to render it as HTML. The HTML is specified either directly within the the body of <netui-data:repeater> tag or within an associated set of "helper" tags. The "helper" tags are listed below.
Tag Description RepeaterHeader
Renders once at the start of the iteration. RepeaterItem
Renders once for each iteration. RepeaterFooter
Renders once at the end of the iteration. Pad
Used to convert irregular data sets into regular data sets through padding or truncating the output. Choice
Used to conditionally render data in the data set based on the result of calling a decision method. This is allowed only within the <netui-data:repeaterItem> tag. ChoiceMethod
Used to define the decision method used when conditionally rendering data. This is allowed only within the <netui-data:repeaterItem> tag.
The <netui-data:repeater> tag can render in two modes; the first mode is a simple mode where the body of the <netui-data:repeater> tag 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 the items in the "customers" data set as an unordered HTML list.
<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 "helper" tags are used to define the rendering of the data set. In this case, if one of the helper tags is present, any HTML markup directly in the body of the <netui-data:repeater> tag is not rendered; rather, the HTML markup inside the helper tags is rendered.
For example, the following will render the same output as the example shown above, but it uses the "helper" tags for rendering the HTML markup:
<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>
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 com.bea.wlw.netui.tags.AbstractBaseTag |
---|
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT |
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants |
---|
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.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()
|
int |
doEndTag()
|
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. |
String |
getDefaultText()
Get the defaultText attribute. |
boolean |
getIgnoreNulls()
Get a boolean that describes whether the repeater should ignore null items encountered while iterating over a data set. |
DataAccessProvider |
getProviderParent()
Get the parent DataAccessProvider 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(String 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 com.bea.wlw.netui.tags.DataSourceTag |
---|
addNamingInterceptor, doNaming, evaluateDataSource, getDataSource, qualifyAttribute, removeNamingInterceptor, setDataSource |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.bea.wlw.netui.tags.DataAccessProvider |
---|
getDataSource, setDataSource |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
getParent, 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 class AbstractBaseTag
public boolean getIgnoreNulls()
true
if ignoring nulls; false
otherwisepublic void setIgnoreNulls(boolean ignoreNulls)
ignoreNulls
- whether or not to ignore nullspublic void setPadContext(PadContext padContext)
padContext
- public String getDefaultText()
null
if unset.public void setDefaultText(String defaultText)
defaultText
- the default textdataSource
attribute references a null data set.public 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 DataAccessProvider
DataAccessProvider
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 DataAccessProvider
DataAccessProvider
public Object getCurrentMetadata()
getCurrentMetadata
in interface DataAccessProvider
null
if no metadata can be
found or metadata is not supported by a DataAccessProvider implementation
UnsupportedOperationException
- this tag does not support this method from the DataAccessProvider interfaceDataAccessProvider
public DataAccessProvider getProviderParent()
container.container
. Any valid properties of the
parent DataAccessProvider can be accessed through this expression. This method
will return null if there is no parent DataAccessProvider
getProviderParent
in interface DataAccessProvider
DataAccessProvider
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
- the RepeaterComponent
to register with the Repeater parentpublic int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if an error occurs that can not be reported in the pagepublic int doAfterBody()
doAfterBody
in interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
in class javax.servlet.jsp.tagext.BodyTagSupport
public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if an error occurs that can not be reported in the pageprotected void localRelease()
localRelease
in class DataSourceTag
|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |