Save This Page
Home » struts-1.3.9-src » org.apache.struts.taglib » html » [javadoc | source]
org.apache.struts.taglib.html
public class: OptionsCollectionTag [javadoc | source]
java.lang.Object
   javax.servlet.jsp.tagext.TagSupport
      org.apache.struts.taglib.html.OptionsCollectionTag

All Implemented Interfaces:
    IterationTag, Serializable

Direct Known Subclasses:
    ELOptionsCollectionTag

Tag for creating multiple <select> options from a collection. The collection may be part of the enclosing form, or may be independent of the form. Each element of the collection must expose a 'label' and a 'value', the property names of which are configurable by attributes of this tag.

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.

Field Summary
protected static  MessageResources messages    The message resources for this package. 
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  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. 
Method from org.apache.struts.taglib.html.OptionsCollectionTag Summary:
addOption,   doStartTag,   getFilter,   getIterator,   getLabel,   getName,   getProperty,   getStyle,   getStyleClass,   getValue,   release,   setFilter,   setLabel,   setName,   setProperty,   setStyle,   setStyleClass,   setValue
Methods from javax.servlet.jsp.tagext.TagSupport:
doAfterBody,   doEndTag,   doStartTag,   findAncestorWithClass,   getId,   getParent,   getValue,   getValues,   release,   removeValue,   setId,   setPageContext,   setParent,   setValue
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts.taglib.html.OptionsCollectionTag Detail:
 protected  void addOption(StringBuffer sb,
    String label,
    String value,
    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.

 public int doStartTag() throws JspException 
    Process the start of this tag.
 public boolean getFilter() 
 protected Iterator getIterator(Object collection) throws JspException 
    Return an iterator for the options collection.
 public String getLabel() 
 public String getName() 
 public String getProperty() 
 public String getStyle() 
 public String getStyleClass() 
 public String getValue() 
 public  void release() 
    Release any acquired resources.
 public  void setFilter(boolean filter) 
 public  void setLabel(String label) 
 public  void setName(String name) 
 public  void setProperty(String property) 
 public  void setStyle(String style) 
 public  void setStyleClass(String styleClass) 
 public  void setValue(String value)