org.apache.struts.taglib.html
クラス OptionsCollectionTag

java.lang.Object
  拡張javax.servlet.jsp.tagext.TagSupport
      拡張org.apache.struts.taglib.html.OptionsCollectionTag
すべての実装インタフェース:
javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
直系の既知のサブクラス:
NestedOptionsCollectionTag

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.

導入されたバージョン:
Struts 1.1
バージョン:
$Revision: 1.1 $ $Date: 2004/10/20 03:26:42 $
関連項目:
直列化された形式

フィールドの概要
protected  boolean filter
          Should the label values be filtered for HTML sensitive characters?
protected  java.lang.String label
          The name of the bean property containing the label.
protected static 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.
private  java.lang.String style
          The style associated with this tag.
private  java.lang.String styleClass
          The named style class associated with this tag.
protected  java.lang.String value
          The name of the bean property containing the value.
 
クラス javax.servlet.jsp.tagext.TagSupport から継承したフィールド
id, pageContext
 
インタフェース javax.servlet.jsp.tagext.IterationTag から継承したフィールド
EVAL_BODY_AGAIN
 
インタフェース javax.servlet.jsp.tagext.Tag から継承したフィールド
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
コンストラクタの概要
OptionsCollectionTag()
           
 
メソッドの概要
protected  void addOption(java.lang.StringBuffer sb, java.lang.String label, java.lang.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  java.util.Iterator getIterator(java.lang.Object collection)
          Return an iterator for the options collection.
 java.lang.String getLabel()
           
 java.lang.String getName()
           
 java.lang.String getProperty()
           
 java.lang.String getStyle()
           
 java.lang.String getStyleClass()
           
 java.lang.String getValue()
           
 void release()
          Release any acquired resources.
 void setFilter(boolean filter)
           
 void setLabel(java.lang.String label)
           
 void setName(java.lang.String name)
           
 void setProperty(java.lang.String property)
           
 void setStyle(java.lang.String style)
           
 void setStyleClass(java.lang.String styleClass)
           
 void setValue(java.lang.String value)
           
 
クラス javax.servlet.jsp.tagext.TagSupport から継承したメソッド
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース javax.servlet.jsp.tagext.IterationTag から継承したメソッド
 

フィールドの詳細

messages

protected static MessageResources messages
The message resources for this package.


filter

protected boolean filter
Should the label values be filtered for HTML sensitive characters?


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.


style

private java.lang.String style
The style associated with this tag.


styleClass

private java.lang.String styleClass
The named style class associated with this tag.


value

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

コンストラクタの詳細

OptionsCollectionTag

public OptionsCollectionTag()
メソッドの詳細

getFilter

public boolean getFilter()

setFilter

public void setFilter(boolean filter)

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)

getStyle

public java.lang.String getStyle()

setStyle

public void setStyle(java.lang.String style)

getStyleClass

public java.lang.String getStyleClass()

setStyleClass

public void setStyleClass(java.lang.String styleClass)

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.

例外:
javax.servlet.jsp.JspException - if a JSP exception has occurred

release

public void release()
Release any acquired resources.


addOption

protected void addOption(java.lang.StringBuffer sb,
                         java.lang.String label,
                         java.lang.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.

パラメータ:
sb - StringBuffer accumulating our results
value - Value to be returned to the server for this option
label - Value to be shown to the user for this option
matched - Should this value be marked as selected?

getIterator

protected java.util.Iterator getIterator(java.lang.Object collection)
                                  throws javax.servlet.jsp.JspException
Return an iterator for the options collection.

パラメータ:
collection - Collection to be iterated over
例外:
javax.servlet.jsp.JspException - if an error occurs


このドキュメントは、Ja-Jakartaにより訳されました。コメントがある場合は、report@jajakarta.orgまでお願いします。
Copyright (C) 2000-2004 - Apache Software Foundation