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.
构造方法摘要 |
Select(com.opensymphony.xwork2.util.ValueStack stack,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
从类 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 |
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)