BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.

com.bea.wlw.netui.tags.databinding.repeater.pad
Class Pad

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.bea.wlw.netui.tags.AbstractBaseTag
              extended by com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
                  extended by com.bea.wlw.netui.tags.databinding.repeater.RepeaterComponent
                      extended by com.bea.wlw.netui.tags.databinding.repeater.pad.Pad
All Implemented Interfaces:
HtmlConstants, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

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
AttributeRequiredRuntime Expression EvaluationData Bindable
maxRepeatNoNoYes
The maximum number of times a RepeaterItem will render.
minRepeatNoNoYes
The minimum number of times a RepeaterItem will render.
padTextNoNoYes
The text to use when padding a Repeater that has rendered too few items.

See Also:
Repeater, Serialized Form
Example:
In the following example, assume that the <netui-data:repeater> tag iterates over a java.util.List object. The <netui-data:pad> limits the iteration to three cycles, no matter how many elements are actually in the List.
    <netui-data:repeater dataSource="{pageFlow.myList}">
         <netui-data:pad maxRepeat="3"/>
             <netui-data:repeaterItem>
                 <netui:label value="{container.item}" />
             </netui-data:repeaterItem>
     </netui-data:repeater>

Sample Code

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_databinding/pad/

Beadoc.see:
<netui-data:pad> Tag Sample
Beadoc.tagdescription:

This tag determines the number of items that are rendered by a Repeater tag. The <netui-data:pad> tag has the ability to turn an irregular data set in the <netui-data:repeater> tag into a regular data set through the use of the three attributes:

  • maxRepeat - truncates the rendering of the data set
  • minRepeat - forces the <netui-data:repeater> to render a minimum number of elements
  • padText - default text to render if the data set does not have the minimum number of elements

If the padText attribute is unset, the body of the <netui-data:pad> tag is used as the default text.


Field Summary
 
Fields inherited from class com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
EMPTY_STRING
 
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
Pad()
           
 
Method Summary
 int doAfterBody()
          Set the pad text from the content that was rendered in the body.
 String getMaxRepeat()
          Get the maximum number of times that the RepeaterItem will be rendered.
 String getMinRepeat()
          Get the minimum number of items to render.
 String getPadText()
          Get the text that is used to pad the items in a Repeater.
 String getTagName()
          Get the name of this tag.
protected  void localRelease()
          Reset all of the fields of this tag.
 int renderEndTag(int state)
          Complete rendering the body of this tag.
 int renderStartTag(int state)
          Render the body of this tag and buffer the output.
 void setMaxRepeat(String maxRepeatString)
          Set the maximum number of items that will be rendered by a Repeater.
 void setMinRepeat(String minRepeatString)
          Set the minimum number of items that will be rendered by a Repeater.
 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 inherited from class com.bea.wlw.netui.tags.databinding.repeater.RepeaterComponent
getCurrentRenderState, getRepeater, getValidContainerType, prepare
 
Methods inherited from class com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
addContent, doEndTag, doStartTag, getContent, verifyStructure
 
Methods inherited from class com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, containsExpression, evaluateAttributeToString, evaluateExpression, filter, filter, formatErrorString, formatString, getAttribute, getErrorsReport, getExpressionEvaluator, getJavaScriptUtils, getNearestForm, getNextId, getQualifiedBundleName, getScriptReporter, getUserLocale, hasErrors, isExpression, prepForRendering, registerAttribute, registerError, registerTagError, release, removeAttribute, renderAttribute, renderAttributes, reportErrors, rewriteName, setPageContext, updateExpression, write
 
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 javax.servlet.jsp.tagext.Tag
getParent, setParent
 

Constructor Detail

Pad

public Pad()
Method Detail

getTagName

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

Specified by:
getTagName in class AbstractBaseTag
Returns:
a constant String representing the name of this tag.

setPadText

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
Beadoc.attributedescription:
The text will be used when padding a <netui-data:repeater> that renders too few times
Beadoc.attributesyntaxvalue:
string_padText
Beadoc.databindable:
true

getPadText

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

setMaxRepeat

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
Beadoc.attributedescription:
Set the maximum number of items that will be rendered by a <netui-data:repeater> tag. If the size of the data set is greater than this, only this many items will be rendered. This value can be an integer or can be an expression that resolves to an integer.
Beadoc.attributesyntaxvalue:
integer_or_expression_maxRepeat
Beadoc.databindable:
true

getMaxRepeat

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

setMinRepeat

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
Beadoc.attributedescription:
Set the minimum number of items that will be rendered by a <netui-data:repeater> tag. If the size of the data set is smaller than this, the data set will be padded with the value of the padText attribute. This value can be an integer or can be an expression that resolves to an integer.
Beadoc.attributesyntaxvalue:
integer_or_expression_minRepeat
Beadoc.databindable:
true

getMinRepeat

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

renderStartTag

public int renderStartTag(int state)
                   throws javax.servlet.jsp.JspException
Render the body of this tag and buffer the output. If the padText attribute is unset, the body content is used instead.

Specified by:
renderStartTag in class StructuredBaseTag
Throws:
javax.servlet.jsp.JspException

doAfterBody

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.

Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class RepeaterComponent
Returns:
SKIP_BODY

renderEndTag

public int renderEndTag(int state)
                 throws javax.servlet.jsp.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:
renderEndTag in class RepeaterComponent
Parameters:
state - the current render state of the Repeater
Returns:
EVAL_PAGE
Throws:
javax.servlet.jsp.JspException - if an error occurs that can not be reported on the page

localRelease

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

Overrides:
localRelease in class RepeaterComponent

verifyAttributes

protected void verifyAttributes()
                         throws javax.servlet.jsp.JspException
Verify that the attributes set on the tag are correct. Check:

Overrides:
verifyAttributes in class StructuredBaseTag
Throws:
javax.servlet.jsp.JspException - if an error occurs that can not be reported on the page

BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.