Pad Class
- public class Pad
extends RepeaterComponent
A tag that affects the number of items that are rendered in a
Repeater
.
The Pad tag has the ability to turn an irregular data set in the
Repeater
into a regular dataset through the use of the three attributes on the Pad tag. The Pad tag can
truncate the rendering of a data set if enough items have been rendered or can
pad a default item text onto the end of a data set that is not big enough. If the padText attribute
is unset, the body of the Pad tag is used as the padText.
Note, the container
data binding context should not be used inside
of the Pad's padText
attribute as binding to both the item
and index
could product unexpected results.
Attribute Descriptions |
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
maxRepeat | No | No | Yes |
The maximum number of times a RepeaterItem will render. |
minRepeat | No | No | Yes |
The minimum number of times a RepeaterItem will render. |
padText | No | No | Yes |
The text to use when padding a Repeater that has rendered too few items. |
Related Topics
<netui-data:pad> Tag Sample
Repeater
-
Hierarchy
-
Object
TagSupport
BodyTagSupport
AbstractBaseTag
StructuredBaseTag
RepeaterComponent
Pad
-
All Implemented Interfaces
-
BodyTag
, IterationTag
, Serializable
, Tag
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
|
public int |
-
doAfterBody ()
- Set the pad text from the content that was rendered in the body.
|
public String |
-
getMaxRepeat ()
- Get the maximum number of times that the RepeaterItem will be rendered.
|
public String |
-
getMinRepeat ()
- Get the minimum number of items to render.
|
public String |
-
getPadText ()
- Get the text that is used to pad the items in a Repeater.
|
public String |
-
getTagName ()
- Get the name of this tag.
|
protected void |
-
localRelease ()
- Reset all of the fields of this tag.
|
public int |
-
renderEndTag (int state)
- Complete rendering the body of this tag.
|
public int |
-
renderStartTag (int state)
- Render the body of this tag and buffer the output.
|
public void |
-
setMaxRepeat (String maxRepeatString)
- Set the maximum number of items that will be rendered by a Repeater.
|
public void |
-
setMinRepeat (String minRepeatString)
- Set the minimum number of items that will be rendered by a Repeater.
|
public void |
-
setPadText (String padText)
- Set the text that will be used when padding a Repeater that
renders its body too few times.
|
protected void |
-
verifyAttributes ()
- Verify that the attributes set on the tag are correct.
|
Methods from com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag |
addContent, doEndTag, doStartTag, getContent, getCurrentRenderState, getValidContainerType, localRelease, prepare, renderEndTag, 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.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 |
Pad
public Pad()
doAfterBody() Method
public int doAfterBody()
Set the pad text from the content that was rendered in the body. This value
is only set when the padText property has not been set.
-
Overrides
-
RepeaterComponent.doAfterBody()
Returns
- SKIP_BODY
getMaxRepeat() Method
public String
getMaxRepeat()
Get the maximum number of times that the RepeaterItem will be rendered.
Returns
- an integer or an expression that references an integer
for the maximum number of items to render or
null
if unset
getMinRepeat() Method
public String
getMinRepeat()
Get the minimum number of items to render.
Returns
- an integer or an expression that references
an integer for the minimum number of items to render
getPadText() Method
public String
getPadText()
Get the text that is used to pad the items in a Repeater.
Returns
- the text that is used to pad a repeater's content
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.
localRelease() Method
protected void localRelease()
Reset all of the fields of this tag.
-
Overrides
-
RepeaterComponent.localRelease()
renderEndTag(int) Method
public int renderEndTag(int state)
throws JspException
Complete rendering the body of this tag. If the padText property was unset,
the body of the tag is used as the pad text.
-
Overrides
-
RepeaterComponent.renderEndTag(int)
Parameters
-
state
- the current render state of the Repeater
Returns
- EVAL_PAGE
Exceptions
-
JspException
- if an error occurs that can not be reported on the page
renderStartTag(int) Method
public int renderStartTag(int state)
throws JspException
Render the body of this tag and buffer the output. If
the padText attribute is unset, the body content is used instead.
-
Overrides
- StructuredBaseTag.renderStartTag(int)
Exceptions
-
JspException
setMaxRepeat(String) Method
public void setMaxRepeat(String
maxRepeatString)
Set the maximum number of items that will be rendered by a Repeater.
If the size of the data set is greater than this, only this many
items will be rendered. This value can be a String of an integer
or can be an expression that references an integer.
Parameters
-
maxRepeatString
- an integer or an expression that references an integer
for the maximum number of items to render
setMinRepeat(String) Method
public void setMinRepeat(String
minRepeatString)
Set the minimum number of items that will be rendered by a Repeater.
If the size of the data set is smaller than this, the data set will
be padded with value of the pad text attribute.
Parameters
-
minRepeatString
- an integer or an expression that references
an integer for the minimum number of items to render
setPadText(String) Method
public void setPadText(String
padText)
Set the text that will be used when padding a Repeater that
renders its body too few times.
Parameters
-
padText
- the text that is used to pad a repeater's content
verifyAttributes() Method
protected void verifyAttributes()
throws JspException
Verify that the attributes set on the tag are correct. Check:
- The minRepeat value can be converted into an integer
- The maxRepeat value can be converted into an integer
- The minRepeat value is less than or equal to the maxRepeat value
-
Overrides
- StructuredBaseTag.verifyAttributes()
Exceptions
-
JspException
- if an error occurs that can not be reported on the page