Class FormElementTag
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
org.deltava.taglib.BrowserInfoTag
org.deltava.taglib.html.ElementTag
org.deltava.taglib.html.FormElementTag
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, Serializable
- Direct Known Subclasses:
CheckTag, ComboTag, FileUploadTag, InputTag, SingleTag, TextboxTag
A class for supporting JSP tags that generate HTML input elements.
- Since:
- 1.0
- Version:
- 10.0
- Author:
- Luke
- See Also:
-
Field Summary
FieldsFields inherited from class ElementTag
_classes, _data, _outModifier and TypeFieldDescriptionprotected final Collection<String> protected final XMLRendererprotected jakarta.servlet.jsp.JspWriterFields inherited from class jakarta.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface jakarta.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface jakarta.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFormElementTag(String elementName, boolean validateParent) Generates an input element tag with a given name. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetDelimValues(String values) Sets multiple values for this input element.voidSets the tab index of this field.voidSets the name of this field.voidsetRequired(boolean isRequired) Sets this field as required for HTML5 browsers.voidSets the value of this input element.protected voidValidates tag state.Methods inherited from class ElementTag
doStartTag, getFormIndexCount, getName, getParentFormTag, release, setClassName, setID, setNumericAttr, setPageContext, setStyleModifier and TypeMethodDescriptionintprotected intGets and increments the current tab index count for the parent form tag.protected StringgetName()Returns the type of HTML element this tag generated.protected FormTagReturns the parent form tag.voidrelease()voidsetClassName(String cName) Sets the CSS class name of this HTML element.voidSets the ID of this HTML element.protected voidsetNumericAttr(String attrName, int value, int minValue) Sets a numeric attribute.voidsetPageContext(jakarta.servlet.jsp.PageContext ctxt) voidAssociates a CSS style with this HTML element.Methods inherited from class BrowserInfoTag
getBrowserContext, passedCAPTCHAModifier and TypeMethodDescriptionprotected HTTPContextDataFetches the browser data.protected booleanReturns whether the user has passed CAPTCHA validation.Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
-
Field Details
-
_value
The value of this input element.
-
-
Constructor Details
-
FormElementTag
Generates an input element tag with a given name.- Parameters:
elementName- the HTML element namevalidateParent- TRUE if parent validation is enabled, otherwise FALSE- See Also:
-
-
Method Details
-
setName
-
setIdx
Sets the tab index of this field. This does nothing if a negative, zero or non-numeric value is passed.- Parameters:
index- the tab index, or * if it should be retrieved from the parent form.- See Also:
-
setValue
Sets the value of this input element. Each implementer needs to render multiple values appropriately.- Parameters:
value- the value(s) for this field
-
setRequired
public void setRequired(boolean isRequired) Sets this field as required for HTML5 browsers.- Parameters:
isRequired- TRUE if required, otherwise FALSE
-
setDelimValues
Sets multiple values for this input element.- Parameters:
values- a comma-delimited list of values
-
validateState
protected void validateState()Validates tag state.- Throws:
IllegalStateException- if not in a FORM and is required
-