Class ComboTag
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
org.deltava.taglib.BrowserInfoTag
org.deltava.taglib.html.ElementTag
org.deltava.taglib.html.FormElementTag
org.deltava.taglib.html.ComboTag
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, Serializable
A JSP tag to support generating HTML combo/list boxes.
- Since:
- 1.0
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class FormElementTag
_valueFields inherited from class ElementTag
_classes, _data, _outFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoEndTag()Generates the combo/listbox by writing a >SELECT< tag, rendering all choices as >OPTION< elements, then writing a >/SELECT< tag.voidrelease()voidsetFirstEntry(Object entry) Allows an entry to be inserted before the rest of the options.voidsetMultiple(boolean allowMulti) Marks this as a listbox (allowing multiple entries).voidsetOnChange(String js) Sets the Javascript to execute when this element's value is changed.voidSets the Javascript to execute when the element is right-clicked.voidsetOptions(Collection<?> choices) Sets the choices for this combo/listbox.voidsetPageContext(jakarta.servlet.jsp.PageContext ctxt) Loads airport formatting preferences from the logged in user.voidsetSize(int size) Sets the size of this combo/list box.voidsetValues(Collection<?> values) Sets the value(s) of this combo/listbox.Methods inherited from class FormElementTag
setDelimValues, setIdx, setName, setRequired, setValue, validateStateMethods inherited from class ElementTag
doStartTag, getFormIndexCount, getName, getParentFormTag, setClassName, setID, setNumericAttr, setStyleMethods inherited from class BrowserInfoTag
getBrowserContext, passedCAPTCHAMethods inherited from class jakarta.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
-
Constructor Details
-
ComboTag
public ComboTag()Create a new combo/listbox tag.
-
-
Method Details
-
setPageContext
public void setPageContext(jakarta.servlet.jsp.PageContext ctxt) Loads airport formatting preferences from the logged in user.- Specified by:
setPageContextin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
setPageContextin classElementTag
-
doEndTag
public int doEndTag() throws jakarta.servlet.jsp.JspExceptionGenerates the combo/listbox by writing a >SELECT< tag, rendering all choices as >OPTION< elements, then writing a >/SELECT< tag.- Specified by:
doEndTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjakarta.servlet.jsp.tagext.TagSupport- Throws:
jakarta.servlet.jsp.JspException- if an I/O error occurs
-
setValues
Sets the value(s) of this combo/listbox.- Parameters:
values- a Collection of selected values
-
setSize
public void setSize(int size) Sets the size of this combo/list box. This does nothing if a negative, zero or non-numeric value is passed.- Parameters:
size- the size of the combo/list box, in entries- See Also:
-
setOnChange
Sets the Javascript to execute when this element's value is changed.- Parameters:
js- the JavaScript code to execute
-
setOnRightClick
Sets the Javascript to execute when the element is right-clicked.- Parameters:
js- the JavaScript code to execute
-
setFirstEntry
Allows an entry to be inserted before the rest of the options.- Parameters:
entry- the first entry to insert
-
setMultiple
public void setMultiple(boolean allowMulti) Marks this as a listbox (allowing multiple entries).- Parameters:
allowMulti- TRUE if enabled, otherwise FALSE
-
setOptions
Sets the choices for this combo/listbox.- Parameters:
choices- a List of choices
-
release
public void release()- Specified by:
releasein interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
releasein classElementTag
-