org.hdiv.taglib.html
Class OptionsTagHDIV
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.apache.struts.taglib.html.OptionsTag
org.hdiv.taglib.html.OptionsTagHDIV
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
- ELOptionsTagHDIV, NestedOptionsTagHDIV
public class OptionsTagHDIV
- extends org.apache.struts.taglib.html.OptionsTag
This Tag created multiple <select> options from a collection. The associated
values displayed to the user may optionally be specified by a second collection,
or will be the same as the values themselves. Each collection may be an array of
objects, a Collection, an Enumeration, an Iterator, or a Map.
The <html:options> element is only valid when nested inside a
<html:select> element. Renders a HTML <option>
element. This tag can be used multiple times within a single
element.
- Author:
- Aritz Rabadan, Gorka Vicente
- See Also:
OptionsTag,
Serialized Form
| Fields inherited from class org.apache.struts.taglib.html.OptionsTag |
collection, filter, labelName, labelProperty, messages, name, property |
| 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 |
|
Method Summary |
protected void |
addOption(java.lang.StringBuffer sb,
java.lang.String value,
java.lang.String label,
boolean matched)
Add an option element to the specified StringBuffer based on the specified
parameters. |
protected void |
prepareAttribute(java.lang.StringBuffer handlers,
java.lang.String name,
java.lang.Object value)
Prepares an attribute if the value is not null, appending it to the the given
StringBuffer. |
| Methods inherited from class org.apache.struts.taglib.html.OptionsTag |
doEndTag, doStartTag, getCollection, getFilter, getIterator, getLabelName, getLabelProperty, getName, getProperty, getStyle, getStyleClass, release, setCollection, setFilter, setLabelName, setLabelProperty, setName, setProperty, setStyle, setStyleClass |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OptionsTagHDIV
public OptionsTagHDIV()
addOption
protected void addOption(java.lang.StringBuffer sb,
java.lang.String value,
java.lang.String label,
boolean matched)
- Add an option element to the specified StringBuffer based on the specified
parameters.
Note that this tag specifically does not support the styleId
tag attribute, which causes the HTML id attribute to be
emitted. This is because the HTML specification states that all "id"
attributes in a document have to be unique. This tag will likely generate more
than one option element element, but it cannot use the same
id value. It's conceivable some sort of mechanism to supply an
array of id values could be devised, but that doesn't seem to
be worth the trouble.
- Overrides:
addOption in class org.apache.struts.taglib.html.OptionsTag
- Parameters:
sb - StringBuffer accumulating our resultsvalue - Value to be returned to the server for this optionlabel - Value to be shown to the user for this optionmatched - Should this value be marked as selected?- See Also:
org.hdiv.composer.IDataComposer#compose(String, String, boolean)
prepareAttribute
protected void prepareAttribute(java.lang.StringBuffer handlers,
java.lang.String name,
java.lang.Object value)
- Prepares an attribute if the value is not null, appending it to the the given
StringBuffer.
- Parameters:
handlers - The StringBuffer that output will be appended to.
Copyright © 2008 hdiv.org. All Rights Reserved.