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
_value
Fields inherited from class org.deltava.taglib.html.ElementTag
_classes, _data, _out
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
doEndTag()
Generates the HTML for this Input element.void
release()
void
setAutoComplete
(boolean isAutoComplete) Disables or enables autocomplete support for this field.void
setAutofill
(String token) Sets the autofill token for this field.void
setDisabled
(boolean disabled) Marks this field as disabled.void
setMax
(int maxLen) Sets the maximum length of this field.void
Sets the JavaScript event for this element's onBlur() event.void
setOnChange
(String jsCode) Sets the JavaScript event for this element's onChange() event.void
setOnKeypress
(String jsCode) Sets the JavaScript event for this element's onKeyPress() event.void
setOnKeyup
(String jsCode) Sets the JavaScript event for this element's onKeyUp() event.void
Sets the Javascript to execute when the element is right-clicked.void
setPlaceholder
(String ph) Sets the placeholder for this field.void
setReadOnly
(boolean readOnly) Marks this field as read-only.void
setSize
(int len) Sets the size of this field.void
setSpellcheck
(boolean sc) Marks this field as spellcheckable.void
Sets the HTML field type.Methods inherited from class org.deltava.taglib.html.FormElementTag
setDelimValues, setIdx, setName, setRequired, setValue, validateState
Methods inherited from class org.deltava.taglib.html.ElementTag
doStartTag, getFormIndexCount, getName, getParentFormTag, setClassName, setID, setNumericAttr, setPageContext, setStyle
Methods inherited from class org.deltava.taglib.BrowserInfoTag
getBrowserContext
Methods 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:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classTagSupport
- Throws:
JspException
- if an error occurs- See Also:
-
release
public void release()- Specified by:
release
in interfaceTag
- Overrides:
release
in 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
-