Class CheckTag
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.CheckTag
- All Implemented Interfaces:
Serializable,IterationTag,JspTag,Tag
A JSP tag to support the generation of HTML multi-option checkboxes and radio buttons.
- Since:
- 1.0
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ObjectAn additional entry prepended to the list of optionsFields 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()Renders the checkbox tags.voidrelease()Releases the tag's state data.voidsetChecked(Collection<Object> values) Sets the selected value(s) of this element.final voidsetClassName(String cName) Sets the CSS class name for the checkbox/radio text .voidsetCols(int columns) Sets the width of the field in columns; afterwards the separator will be outputted.voidsetFirstEntry(Object entry) Allows an entry to be inserted before the rest of the options.voidSets the check box name, saving for the CSS class.voidsetNewLine(boolean doNewLine) Sets the multiple element separator to a DIV with a new line.voidsetOnChange(String jsEvent) Sets the JavaScript onChange event for these checkboxes/radio buttons.voidsetOptions(Collection<?> choices) Sets the choices for this checkbox/radio button.voidsetSeparator(String sep) Sets the multiple element separator.voidSets the element type.voidsetWidth(int width) Sets the width of each checkbox entry.Methods inherited from class org.deltava.taglib.html.FormElementTag
setDelimValues, setIdx, setRequired, setValue, validateStateMethods inherited from class org.deltava.taglib.html.ElementTag
doStartTag, getFormIndexCount, getName, getParentFormTag, setID, setNumericAttr, setPageContext, 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
-
Field Details
-
_firstEntry
An additional entry prepended to the list of options
-
-
Constructor Details
-
CheckTag
public CheckTag()Creates a new checkbox/radio tag.
-
-
Method Details
-
setCols
public void setCols(int columns) Sets the width of the field in columns; afterwards the separator will be outputted.- Parameters:
columns- the number of columns
-
setWidth
public void setWidth(int width) Sets the width of each checkbox entry.- Parameters:
width- the width in pixels
-
setName
Sets the check box name, saving for the CSS class.- Overrides:
setNamein classFormElementTag- Parameters:
name- the field name
-
setFirstEntry
Allows an entry to be inserted before the rest of the options.- Parameters:
entry- the first entry to insert
-
setOnChange
Sets the JavaScript onChange event for these checkboxes/radio buttons.- Parameters:
jsEvent- the JavaScript event code
-
doEndTag
Renders the checkbox tags.- Specified by:
doEndTagin interfaceTag- Overrides:
doEndTagin classTagSupport- Returns:
- EVAL_PAGE always
- Throws:
JspException- if an error occurs
-
release
public void release()Releases the tag's state data.- Specified by:
releasein interfaceTag- Overrides:
releasein classElementTag
-
setClassName
Sets the CSS class name for the checkbox/radio text .- Overrides:
setClassNamein classElementTag- Parameters:
cName- the CSS class name(s)- See Also:
-
setType
Sets the element type. Updats the default CSS class to "check" or "radio".- Parameters:
checkType- the element type, typically RADIO or CHECKBOX
-
setSeparator
Sets the multiple element separator.- Parameters:
sep- the string to insert between multiple elements- See Also:
-
setNewLine
public void setNewLine(boolean doNewLine) Sets the multiple element separator to a DIV with a new line.- Parameters:
doNewLine- TRUE if the separator should be set, otherwise FALSE- See Also:
-
setChecked
Sets the selected value(s) of this element.- Parameters:
values- a List of selected values of this element
-
setOptions
Sets the choices for this checkbox/radio button.- Parameters:
choices- a Collection of choices
-