Class InputTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.deltava.taglib.BrowserInfoTag
org.deltava.taglib.html.ElementTag
org.deltava.taglib.html.FormElementTag
org.deltava.taglib.html.InputTag
- All Implemented Interfaces:
Serializable,IterationTag,JspTag,Tag
- Direct Known Subclasses:
AirportCodeTag,EMailInputTag,HTML5InputTag
A JSP tag to generate HTML text field elements.
- Since:
- 1.0
- Version:
- 10.3
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class org.deltava.taglib.html.FormElementTag
_valueFields inherited from class org.deltava.taglib.html.ElementTag
_classes, _data, _outFields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoEndTag()Generates the HTML for this Input element.voidrelease()voidsetAutoComplete(boolean isAutoComplete) Disables or enables autocomplete support for this field.voidsetAutofill(String token) Sets the autofill token for this field.voidsetDisabled(boolean disabled) Marks this field as disabled.voidsetMax(int maxLen) Sets the maximum length of this field.voidSets the JavaScript event for this element's onBlur() event.voidsetOnChange(String jsCode) Sets the JavaScript event for this element's onChange() event.voidsetOnKeypress(String jsCode) Sets the JavaScript event for this element's onKeyPress() event.voidsetOnKeyup(String jsCode) Sets the JavaScript event for this element's onKeyUp() event.voidSets the Javascript to execute when the element is right-clicked.voidsetPlaceholder(String ph) Sets the placeholder for this field.voidsetReadOnly(boolean readOnly) Marks this field as read-only.voidsetSize(int len) Sets the size of this field.voidsetSpellcheck(boolean sc) Marks this field as spellcheckable.voidSets the HTML field type.Methods inherited from class org.deltava.taglib.html.FormElementTag
setDelimValues, setIdx, setName, setRequired, setValue, validateStateMethods inherited from class org.deltava.taglib.html.ElementTag
doStartTag, getFormIndexCount, getName, getParentFormTag, setClassName, setID, setNumericAttr, setPageContext, setStyleMethods inherited from class org.deltava.taglib.BrowserInfoTag
getBrowserContext, passedCAPTCHAMethods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
-
Constructor Details
-
InputTag
public InputTag()Create a new Input element tag of type TEXT.- See Also:
-
-
Method Details
-
doEndTag
Generates the HTML for this Input element. If a non-String value is set, this method calls the value's toString() method to render it.- Specified by:
doEndTagin interfaceTag- Overrides:
doEndTagin classTagSupport- Throws:
JspException- if an error occurs- See Also:
-
release
public void release()- Specified by:
releasein interfaceTag- Overrides:
releasein classElementTag
-
setType
Sets the HTML field type. This is typically either TEXT or HIDDEN. If no type is explictly set, then the TYPE will be rendered as TEXT.- Parameters:
type- the field type
-
setSize
public void setSize(int len) Sets the size of this field. This does nothing if a negative, zero or non-numeric value is passed.- Parameters:
len- the size of the field- See Also:
-
setMax
public void setMax(int maxLen) Sets the maximum length of this field. This does nothing if a negative, zero or non-numeric value is passed.- Parameters:
maxLen- the maximum length of the field- See Also:
-
setAutoComplete
public void setAutoComplete(boolean isAutoComplete) Disables or enables autocomplete support for this field.- Parameters:
isAutoComplete- TRUE if AutoComplete enabled, otherwise FASE
-
setAutofill
Sets the autofill token for this field. This will automatically enable autocomplete.- Parameters:
token- the autofill token
-
setReadOnly
public void setReadOnly(boolean readOnly) Marks this field as read-only.- Parameters:
readOnly- TRUE if read-only, otherwise FALSE
-
setDisabled
public void setDisabled(boolean disabled) Marks this field as disabled.- Parameters:
disabled- TRUE if disabled, otherwise FALSE
-
setSpellcheck
public void setSpellcheck(boolean sc) Marks this field as spellcheckable.- Parameters:
sc- TRUE if spellcheck enabled, otherwise FALSE
-
setPlaceholder
Sets the placeholder for this field.- Parameters:
ph- the placeholder string
-
setOnBlur
Sets the JavaScript event for this element's onBlur() event.- Parameters:
jsCode- the JavaScript code
-
setOnChange
Sets the JavaScript event for this element's onChange() event.- Parameters:
jsCode- the JavaScript code
-
setOnKeyup
Sets the JavaScript event for this element's onKeyUp() event.- Parameters:
jsCode- the JavaScript code
-
setOnKeypress
Sets the JavaScript event for this element's onKeyPress() event.- Parameters:
jsCode- the JavaScript code
-
setOnRightClick
Sets the Javascript to execute when the element is right-clicked.- Parameters:
js- the JavaScript code to execute
-