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

All Implemented Interfaces:
    IterationTag, Serializable

Direct Known Subclasses:
    ELOptionsTag

Tag for creating 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. 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  String collection    The name of the collection containing beans that have properties to provide both the values and the labels (identified by the property and labelProperty attributes). 
protected  boolean filter    Should the label values be filtered for HTML sensitive characters? 
protected  String labelName    The name of the bean containing the labels collection. 
protected  String labelProperty    The bean property containing the labels collection. 
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. 
Method from org.apache.struts.taglib.html.OptionsTag Summary:
addOption,   doEndTag,   doStartTag,   getCollection,   getFilter,   getIterator,   getLabelName,   getLabelProperty,   getName,   getProperty,   getStyle,   getStyleClass,   release,   setCollection,   setFilter,   setLabelName,   setLabelProperty,   setName,   setProperty,   setStyle,   setStyleClass
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.OptionsTag Detail:
 protected  void addOption(StringBuffer sb,
    String value,
    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.

 public int doEndTag() throws JspException 
    Process the end of this tag.
 public int doStartTag() throws JspException 
    Process the start of this tag.
 public String getCollection() 
 public boolean getFilter() 
 protected Iterator getIterator(String name,
    String property) throws JspException 
    Return an iterator for the option labels or values, based on our configured properties.
 public String getLabelName() 
 public String getLabelProperty() 
 public String getName() 
 public String getProperty() 
 public String getStyle() 
 public String getStyleClass() 
 public  void release() 
    Release any acquired resources.
 public  void setCollection(String collection) 
 public  void setFilter(boolean filter) 
 public  void setLabelName(String labelName) 
 public  void setLabelProperty(String labelProperty) 
 public  void setName(String name) 
 public  void setProperty(String property) 
 public  void setStyle(String style) 
 public  void setStyleClass(String styleClass)