Class ComboTag
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.ComboTag
- All Implemented Interfaces:
Serializable
,IterationTag
,JspTag
,Tag
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 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 combo/listbox by writing a >SELECT< tag, rendering all choices as >OPTION< elements, then writing a >/SELECT< tag.void
release()
void
setFirstEntry
(Object entry) Allows an entry to be inserted before the rest of the options.void
setMultiple
(boolean allowMulti) Marks this as a listbox (allowing multiple entries).void
setOnChange
(String js) Sets the Javascript to execute when this element's value is changed.void
Sets the Javascript to execute when the element is right-clicked.void
setOptions
(Collection<?> choices) Sets the choices for this combo/listbox.void
setPageContext
(PageContext ctxt) Loads airport formatting preferences from the logged in user.void
setSize
(int size) Sets the size of this combo/list box.void
setValues
(Collection<?> values) Sets the value(s) of this combo/listbox.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, 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
-
ComboTag
public ComboTag()Create a new combo/listbox tag.
-
-
Method Details
-
setPageContext
Loads airport formatting preferences from the logged in user.- Specified by:
setPageContext
in interfaceTag
- Overrides:
setPageContext
in classElementTag
-
doEndTag
Generates the combo/listbox by writing a >SELECT< tag, rendering all choices as >OPTION< elements, then writing a >/SELECT< tag.- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classTagSupport
- Throws:
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:
release
in interfaceTag
- Overrides:
release
in classElementTag
-