public class OptionsCollectionTag
extends javax.servlet.jsp.tagext.TagSupport
The collection may be an array of objects, a Collection, an Enumeration, an Iterator, or a Map.
NOTE - This tag requires a Java2 (JDK 1.2 or later) platform.
Modifier and Type | Field and Description |
---|---|
protected boolean |
filter
Should the label values be filtered for HTML sensitive characters?
|
protected String |
label
The name of the bean property containing the label.
|
protected static MessageResources |
messages
The message resources for this package.
|
protected String |
name
The name of the bean containing the values collection.
|
protected String |
property
The name of the property to use to build the values collection.
|
protected String |
value
The name of the bean property containing the value.
|
Constructor and Description |
---|
OptionsCollectionTag() |
Modifier and Type | Method and Description |
---|---|
protected void |
addOption(StringBuffer sb,
String label,
String value,
boolean matched)
Add an option element to the specified StringBuffer based on the
specified parameters.
|
int |
doStartTag()
Process the start of this tag.
|
boolean |
getFilter() |
protected Iterator |
getIterator(Object collection)
Return an iterator for the options collection.
|
String |
getLabel() |
String |
getName() |
String |
getProperty() |
String |
getStyle() |
String |
getStyleClass() |
String |
getValue() |
void |
release()
Release any acquired resources.
|
void |
setFilter(boolean filter) |
void |
setLabel(String label) |
void |
setName(String name) |
void |
setProperty(String property) |
void |
setStyle(String style) |
void |
setStyleClass(String styleClass) |
void |
setValue(String value) |
protected static MessageResources messages
protected boolean filter
protected String label
protected String name
protected String property
protected String value
public boolean getFilter()
public void setFilter(boolean filter)
public String getLabel()
public void setLabel(String label)
public String getName()
public void setName(String name)
public String getProperty()
public void setProperty(String property)
public String getStyle()
public void setStyle(String style)
public String getStyleClass()
public void setStyleClass(String styleClass)
public String getValue()
public void setValue(String value)
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredpublic void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.TagSupport
protected void addOption(StringBuffer sb, String label, String value, boolean matched)
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.
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?Copyright © 2000–2016 Apache Software Foundation. All rights reserved.