|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTagSupport
BodyTagSupport
AbstractClassicTag
HtmlGroupBaseTag
CheckBoxGroup
public class CheckBoxGroup
Groups a collection of CheckBoxOptions, and handles databinding of their values. CheckBoxGroup binds to an Iterator of Strings. If CheckBoxGroup uses any Format tags, it must have those tags come before any nested CheckBoxOption tags.
preferredColors
.
<netui:checkBoxGroup dataSource="{actionForm.preferredColors}" optionsDataSource="{pageFlow.colors}" />The
optionsDataSource
attribute points to a String[] on the Controller file:
colors = new String[] {"Red", "Blue", "Green", "Yellow", "White", "Black"};This automatically renders the appropriate set of checkbox options within the <checkBoxGroup>:
<input type="checkbox" value="Red">Red</input> <input type="checkbox" value="Blue">Blue</input> <input type="checkbox" value="Green">Green</input> <input type="checkbox" value="Yellow">Yellow</input> <input type="checkbox" value="White">White</input> <input type="checkbox" value="Black">Black</input>The
defaultValue
attribute may point to a String or a String[].
defaultValue = new String ("Blue");
defaultValue = new String[] {"Red", "Blue"};In either case, the appropriate checkbox options will appear checked in the browser.
<input type="checkbox" value="Red" checked="true">Red</input> <input type="checkbox" value="Blue" checked="true">Blue</input> <input type="checkbox" value="Green">Green</input> <input type="checkbox" value="Yellow">Yellow</input> <input type="checkbox" value="White">White</input> <input type="checkbox" value="Black">Black</input>
Field Summary | |
---|---|
static String |
CHECKBOXGROUP_KEY
This is the name of the prefixHandler for the checkbox grup. |
Fields inherited from class HtmlGroupBaseTag |
---|
_cr, _dataSource, _defaultValue, _disabled, _labelStyle, _labelStyleClass, _optionsDataSource, _repCurItem, _repeater, _repIdx, HORIZONTAL_VALUE, VERTICAL_VALUE |
Fields inherited from class AbstractClassicTag |
---|
DefaultNamingChain, EMPTY_STRING, NETUI_UNIQUE_CNT |
Fields inherited from class BodyTagSupport |
---|
bodyContent |
Fields inherited from class TagSupport |
---|
id, pageContext |
Fields inherited from interface BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
CheckBoxGroup()
|
Method Summary | |
---|---|
void |
createHiddenField(AbstractRenderAppender results)
|
int |
doAfterBody()
Save any body content of this tag, which will generally be the option(s) representing the values displayed to the user. |
int |
doEndTag()
Render the set of CheckBoxOptions. |
int |
doStartTag()
Determine the set of matches for the CheckBoxGroup |
protected List |
getNamingChain()
Return an ArrayList which represents a chain of INameInterceptor
objects. |
String |
getTagName()
Return the name of the Tag. |
boolean |
isMatched(String value,
Boolean defaultValue)
Checks whether the given value matches one of the CheckBoxGroup's selected CheckBoxOptions. |
protected void |
localRelease()
Release any acquired resources. |
Methods inherited from class BodyTagSupport |
---|
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
Methods inherited from class TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Tag |
---|
getParent, setPageContext, setParent |
Field Detail |
---|
public static final String CHECKBOXGROUP_KEY
Constructor Detail |
---|
public CheckBoxGroup()
Method Detail |
---|
public String getTagName()
getTagName
in interface INetuiTag
getTagName
in class AbstractClassicTag
protected List getNamingChain()
ArrayList
which represents a chain of INameInterceptor
objects. This method by default returns null
and should be overridden
by objects that support naming.
getNamingChain
in class HtmlGroupBaseTag
ArrayList
that will contain INameInterceptor
objects.public boolean isMatched(String value, Boolean defaultValue)
isMatched
in class HtmlGroupBaseTag
value
- Value to be compared
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class BodyTagSupport
JspException
- if a JSP exception has occurredpublic int doAfterBody() throws JspException
doAfterBody
in interface IterationTag
doAfterBody
in class BodyTagSupport
JspException
- if a JSP exception has occurredpublic int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class BodyTagSupport
JspException
- if a JSP exception has occurredpublic void createHiddenField(AbstractRenderAppender results) throws JspException
JspException
protected void localRelease()
localRelease
in class HtmlGroupBaseTag
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |