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
_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 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(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 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, 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
-
ComboTag
public ComboTag()Create a new combo/listbox tag.
-
-
Method Details
-
setPageContext
Loads airport formatting preferences from the logged in user.- Specified by:
setPageContextin interfaceTag- Overrides:
setPageContextin classElementTag
-
doEndTag
Generates the combo/listbox by writing a >SELECT< tag, rendering all choices as >OPTION< elements, then writing a >/SELECT< tag.- Specified by:
doEndTagin interfaceTag- Overrides:
doEndTagin 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:
releasein interfaceTag- Overrides:
releasein classElementTag
-