org.apache.struts2.components
类 Select

java.lang.Object
  继承者 org.apache.struts2.components.Component
      继承者 org.apache.struts2.components.UIBean
          继承者 org.apache.struts2.components.ListUIBean
              继承者 org.apache.struts2.components.Select
直接已知子类:
UpDownSelect

public class Select
extends ListUIBean

Render an HTML input tag of type select.

Examples

 

 <s:select label="Pets"
        name="petIds"
        list="petDao.pets"
        listKey="id"
        listValue="name"
        multiple="true"
        size="3"
        required="true"
        value="%{petDao.pets.{id}}"
 />

 <s:select label="Months"
        name="months"
        headerKey="-1" headerValue="Select Month"
        list="#{'01':'Jan', '02':'Feb', [...]}"
        value="selectedMonth"
        required="true"
 />

 // The month id (01, 02, ...) returned by the getSelectedMonth() call
 // against the stack will be auto-selected

 
 

Note: For any of the tags that use lists (select probably being the most ubiquitous), which uses the OGNL list notation (see the "months" example above), it should be noted that the map key created (in the months example, the '01', '02', etc.) is typed. '1' is a char, '01' is a String, "1" is a String. This is important since if the value returned by your "value" attribute is NOT the same type as the key in the "list" attribute, they WILL NOT MATCH, even though their String values may be equivalent. If they don't match, nothing in your list will be auto-selected.


字段摘要
static String TEMPLATE
           
 
从类 org.apache.struts2.components.Component 继承的字段
COMPONENT_STACK
 
构造方法摘要
Select(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
方法摘要
 void evaluateExtraParams()
           
 void setEmptyOption(String emptyOption)
           
 void setHeaderKey(String headerKey)
           
 void setHeaderValue(String headerValue)
           
 void setMultiple(String multiple)
           
 void setSize(String size)
           
 
从类 org.apache.struts2.components.ListUIBean 继承的方法
contains, setList, setListCssClass, setListCssStyle, setListKey, setListTitle, setListValue, setThrowExceptionOnNullValueAttribute
 
从类 org.apache.struts2.components.UIBean 继承的方法
addFormParameter, copyParams, end, evaluateParams, getId, getTemplate, getTemplateDir, getTheme, setAccesskey, setCssClass, setCssErrorClass, setCssErrorStyle, setCssStyle, setDefaultTemplateDir, setDefaultUITheme, setDisabled, setDynamicAttributes, setErrorPosition, setId, setJavascriptTooltip, setKey, setLabel, setLabelposition, setLabelSeparator, setName, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setRequiredLabel, setRequiredPosition, setTabindex, setTemplate, setTemplateDir, setTemplateEngineManager, setTheme, setTitle, setTooltip, setTooltipConfig, setTooltipCssClass, setTooltipDelay, setTooltipIconPath, setUIThemeExpansionToken, setValue
 
从类 org.apache.struts2.components.Component 继承的方法
addAllParameters, addParameter, altSyntax, getComponentStack, getParameters, getStack, setActionMapper, setThrowExceptionsOnELFailure, setUrlHelper, start, usesBody
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

TEMPLATE

public static final String TEMPLATE
另请参见:
常量字段值
构造方法详细信息

Select

public Select(com.opensymphony.xwork2.util.ValueStack stack,
              javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
方法详细信息

evaluateExtraParams

public void evaluateExtraParams()
覆盖:
ListUIBean 中的 evaluateExtraParams

setEmptyOption

public void setEmptyOption(String emptyOption)

setHeaderKey

public void setHeaderKey(String headerKey)

setHeaderValue

public void setHeaderValue(String headerValue)

setMultiple

public void setMultiple(String multiple)

setSize

public void setSize(String size)