Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.struts.taglib.wml
Class OptionsCollectionTag  view OptionsCollectionTag download OptionsCollectionTag.java

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byorg.apache.struts.taglib.wml.OptionsCollectionTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class OptionsCollectionTag
extends javax.servlet.jsp.tagext.TagSupport

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.

Since:
Struts 1.1
Version:
$Revision: 1.1.1.1 $ $Date: 2002/12/03 18:08:27 $,

Field Summary
protected  java.lang.String label
          The name of the bean property containing the label.
protected static org.apache.struts.util.MessageResources messages
          The message resources for this package.
protected  java.lang.String name
          The name of the bean containing the values collection.
protected  java.lang.String property
          The name of the property to use to build the values collection.
protected  java.lang.String value
          The name of the bean property containing the value.
 
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
 
Constructor Summary
OptionsCollectionTag()
           
 
Method Summary
protected  void addOption(java.lang.StringBuffer sb, java.lang.String label, java.lang.String value)
          Add an option element to the specified StringBuffer based on the specified parameters.
 int doStartTag()
          Process the start of this tag.
protected  java.util.Iterator getIterator(java.lang.Object collection)
          Return an iterator for the option labels or values, based on our configured properties.
 java.lang.String getLabel()
           
 java.lang.String getName()
           
 java.lang.String getProperty()
           
 java.lang.String getValue()
           
 void release()
          Release any acquired resources.
 void setLabel(java.lang.String label)
           
 void setName(java.lang.String name)
           
 void setProperty(java.lang.String property)
           
 void setValue(java.lang.String value)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, 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
 

Field Detail

messages

protected static org.apache.struts.util.MessageResources messages
The message resources for this package.


label

protected java.lang.String label
The name of the bean property containing the label.


name

protected java.lang.String name
The name of the bean containing the values collection.


property

protected java.lang.String property
The name of the property to use to build the values collection.


value

protected java.lang.String value
The name of the bean property containing the value.

Constructor Detail

OptionsCollectionTag

public OptionsCollectionTag()
Method Detail

getLabel

public java.lang.String getLabel()

setLabel

public void setLabel(java.lang.String label)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getProperty

public java.lang.String getProperty()

setProperty

public void setProperty(java.lang.String property)

getValue

public java.lang.String getValue()

setValue

public void setValue(java.lang.String value)

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Process the start of this tag.


release

public void release()
Release any acquired resources.


addOption

protected void addOption(java.lang.StringBuffer sb,
                         java.lang.String label,
                         java.lang.String value)
Add an option element to the specified StringBuffer based on the specified parameters.


getIterator

protected java.util.Iterator getIterator(java.lang.Object collection)
                                  throws javax.servlet.jsp.JspException
Return an iterator for the option labels or values, based on our configured properties.