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 Object
An additional entry prepended to the list of optionsFields 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()
Renders the checkbox tags.void
release()
Releases the tag's state data.void
setChecked
(Collection<Object> values) Sets the selected value(s) of this element.final void
setClassName
(String cName) Sets the CSS class name for the checkbox/radio text .void
setCols
(int columns) Sets the width of the field in columns; afterwards the separator will be outputted.void
setFirstEntry
(Object entry) Allows an entry to be inserted before the rest of the options.void
Sets the check box name, saving for the CSS class.void
setNewLine
(boolean doNewLine) Sets the multiple element separator to a DIV with a new line.void
setOnChange
(String jsEvent) Sets the JavaScript onChange event for these checkboxes/radio buttons.void
setOptions
(Collection<?> choices) Sets the choices for this checkbox/radio button.void
setSeparator
(String sep) Sets the multiple element separator.void
Sets the element type.void
setWidth
(int width) Sets the width of each checkbox entry.Methods inherited from class org.deltava.taglib.html.FormElementTag
setDelimValues, setIdx, setRequired, setValue, validateState
Methods inherited from class org.deltava.taglib.html.ElementTag
doStartTag, getFormIndexCount, getName, getParentFormTag, setID, setNumericAttr, setPageContext, 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
-
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:
setName
in 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:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classTagSupport
- Returns:
- EVAL_PAGE always
- Throws:
JspException
- if an error occurs
-
release
public void release()Releases the tag's state data.- Specified by:
release
in interfaceTag
- Overrides:
release
in classElementTag
-
setClassName
Sets the CSS class name for the checkbox/radio text .- Overrides:
setClassName
in 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
-