org.apache.beehive.netui.tags.html
Class TextBox

Object
  extended by TagSupport
      extended by BodyTagSupport
          extended by AbstractClassicTag
              extended by HtmlBaseTag
                  extended by HtmlFocusBaseTag
                      extended by HtmlDataSourceTag
                          extended by HtmlDefaultableDataSourceTag
                              extended by TextBox
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, HtmlConstants, IFormattable, IAttributeConsumer, IHtmlAccessable, IHtmlAttrs, IHtmlCore, IHtmlEvents, IHtmlI18n, INetuiTag

public class TextBox
extends HtmlDefaultableDataSourceTag
implements IFormattable, IHtmlAccessable

Renders a databound TextBox with the given attributes.

See Also:
Serialized Form
Example
In this sample, a <netui:textBox> reads from and writes to the Form Bean's firstname property. If the submitted text is NULL, the default value is specified by the Page Flow's firstName property.
     <netui:textBox dataSource="actionForm.firstName"
           defaultValue="${pageFlow.defaultFirstName}"
           size="20" />

Field Summary
 
Fields inherited from class HtmlDefaultableDataSourceTag
_defaultValue
 
Fields inherited from class HtmlDataSourceTag
_dataSource
 
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 HtmlConstants
ABBR, ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, AREA, AXIS, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, BUTTON, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COLSPAN, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEADERS, 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, LANGUAGE, 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, ROWSPAN, RULES, SCOPE, SCRIPT, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TBODY, TD, TEXT, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH
 
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
TextBox()
           
 
Method Summary
 void addFormatter(FormatTag.Formatter formatter)
          Adds a FormatTag.Formatter to the TextBox's set of formatters
 int doEndTag()
          Render the TextBox.
 int doStartTag()
          Prepare the TextBox's formatters.
 void formatterHasError()
          Indicate that a formatter has reported an error so the formatter should output it's body text.
protected  boolean getPassword()
          Get the password state.
protected  AbstractHtmlState getState()
          This method will return the state associated with the tag.
 String getTagName()
          Return the name of the Tag.
protected  void localRelease()
          Release any acquired resources.
 void setAccessKey(char accessKey)
          Sets the accessKey attribute value.
 void setAlt(String alt)
          Sets the alt attribute value.
 void setAttribute(String name, String value, String facet)
          Base support for the attribute tag.
 void setMaxlength(int maxlength)
          Set the maximum length (in characters) of the TextBox.
 void setPassword(boolean password)
          Set the password state (true means this is a password field).
 void setReadonly(boolean readonly)
          Set if this TextBox is read-only.
 void setSize(int size)
          Set the size (in characters) of the TextBox.
 void setTabindex(int tabindex)
          Sets the tabIndex of the rendered html tag.
 
Methods inherited from class HtmlDefaultableDataSourceTag
setDefaultValue
 
Methods inherited from class HtmlDataSourceTag
evaluateDataSource, getNamingChain, nameHtmlControl, setDataSource
 
Methods inherited from class HtmlFocusBaseTag
isDisabled, setDisabled, setOnBlur, setOnChange, setOnFocus, setOnSelect
 
Methods inherited from class HtmlBaseTag
getJavaScriptAttribute, getOnClick, getTagId, renderDefaultNameAndId, renderNameAndId, setDir, setLang, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setStateAttribute, setStyle, setStyleClass, setTagId, setTitle
 
Methods inherited from class AbstractClassicTag
applyNamingChain, getErrorsReport, getIdForTagId, getNearestForm, getNextId, getScriptReporter, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, reportAndExit, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class BodyTagSupport
doAfterBody, 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 IHtmlCore
setStyle, setStyleClass, setTagId, setTitle
 
Methods inherited from interface Tag
getParent, setPageContext, setParent
 

Constructor Detail

TextBox

public TextBox()
Method Detail

getTagName

public String getTagName()
Return the name of the Tag.

Specified by:
getTagName in interface INetuiTag
Specified by:
getTagName in class AbstractClassicTag
Returns:
the name of the tag.

getState

protected AbstractHtmlState getState()
This method will return the state associated with the tag. This is used by this base class to access the individual state objects created by the tags.

Specified by:
getState in class HtmlBaseTag
Returns:
a subclass of the AbstractHtmlState class.

setAttribute

public void setAttribute(String name,
                         String value,
                         String facet)
                  throws JspException
Base support for the attribute tag. This is overridden to prevent setting the type, and value attributes.

Specified by:
setAttribute in interface IAttributeConsumer
Overrides:
setAttribute in class HtmlBaseTag
Parameters:
name - The name of the attribute. This value may not be null or the empty string.
value - The value of the attribute. This may contain an expression.
facet - The name of a facet to which the attribute will be applied. This is optional.
Throws:
JspException - A JspException may be thrown if there is an error setting the attribute.

setMaxlength

public void setMaxlength(int maxlength)
Set the maximum length (in characters) of the TextBox.

Parameters:
maxlength - the max length

setPassword

public void setPassword(boolean password)
Set the password state (true means this is a password field).

Parameters:
password - the password state

getPassword

protected boolean getPassword()
Get the password state.

Returns:
true if the text box is used for passwords. false otherwise.

setReadonly

public void setReadonly(boolean readonly)
Set if this TextBox is read-only.

Parameters:
readonly - the read-only state

setSize

public void setSize(int size)
Set the size (in characters) of the TextBox.

Parameters:
size - the size

setAccessKey

public void setAccessKey(char accessKey)
Sets the accessKey attribute value. This should key value of the keyboard navigation key. It is recommended not to use the following values because there are often used by browsers A, C, E, F, G, H, V, left arrow, and right arrow.

Specified by:
setAccessKey in interface IHtmlAccessable
Parameters:
accessKey - the accessKey value.

setAlt

public void setAlt(String alt)
Sets the alt attribute value.

Specified by:
setAlt in interface IHtmlAccessable
Parameters:
alt - the alt value.

setTabindex

public void setTabindex(int tabindex)
Sets the tabIndex of the rendered html tag.

Parameters:
tabindex - the tab index.

doStartTag

public int doStartTag()
               throws JspException
Prepare the TextBox's formatters.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class BodyTagSupport
Throws:
JspException - if a JSP exception has occurred

doEndTag

public int doEndTag()
             throws JspException
Render the TextBox.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class BodyTagSupport
Throws:
JspException - if a JSP exception has occurred

localRelease

protected void localRelease()
Release any acquired resources.

Overrides:
localRelease in class HtmlDefaultableDataSourceTag

addFormatter

public void addFormatter(FormatTag.Formatter formatter)
Adds a FormatTag.Formatter to the TextBox's set of formatters

Specified by:
addFormatter in interface IFormattable
Parameters:
formatter - a FormatTag.Formatter added by a child FormatTag.

formatterHasError

public void formatterHasError()
Indicate that a formatter has reported an error so the formatter should output it's body text.

Specified by:
formatterHasError in interface IFormattable