| java.lang.Object com.opensymphony.webwork.components.Component com.opensymphony.webwork.components.UIBean com.opensymphony.webwork.components.ListUIBean com.opensymphony.webwork.components.Select
All known Subclasses: com.opensymphony.webwork.components.UpDownSelect,
Select | public class Select extends ListUIBean (Code) | |
Render an HTML input tag of type select.
Examples
<ww:select label="Pets"
name="petIds"
list="petDao.pets"
listKey="id"
listValue="name"
multiple="true"
size="3"
required="true"
/>
<ww: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.
author: Patrick Lightbody author: Rene Gielen author: tm_jee version: $Revision: 2468 $ since: 2.2 |
evaluateExtraParams | public void evaluateExtraParams()(Code) | | |
getDefaultTemplate | protected String getDefaultTemplate()(Code) | | |
setEmptyOption | public void setEmptyOption(String emptyOption)(Code) | | Whether or not to add an empty (--) option after the header option
|
setHeaderKey | public void setHeaderKey(String headerKey)(Code) | | Key for first item in list. Must not be empty! "'-1'" and "''" is correct, "" is bad.
|
setHeaderValue | public void setHeaderValue(String headerValue)(Code) | | Value expression for first item in list
|
setMultiple | public void setMultiple(String multiple)(Code) | | Creates a multiple select. The tag will pre-select multiple values if the values are passed as an Array (of appropriate types) via the value attribute. Passing a Collection may work too? Haven't tested this.
|
setSize | public void setSize(String size)(Code) | | Size of the element box (# of elements to show)
|
Methods inherited from com.opensymphony.webwork.components.Component | public void addAllParameters(Map params)(Code)(Java Doc) public void addParameter(String key, Object value)(Code)(Java Doc) public boolean altSyntax()(Code)(Java Doc) public void copyParams(Map params)(Code)(Java Doc) protected String determineActionURL(String action, String namespace, String method, HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme, boolean includeContext, boolean encodeResult, boolean escapeXml)(Code)(Java Doc) protected String determineNamespace(String namespace, OgnlValueStack stack, HttpServletRequest req)(Code)(Java Doc) public boolean end(Writer writer, String body)(Code)(Java Doc) protected boolean end(Writer writer, String body, boolean popComponentStack)(Code)(Java Doc) protected WebWorkException fieldError(String field, String errorMsg, Exception e)(Code)(Java Doc) protected Component findAncestor(Class clazz)(Code)(Java Doc) protected String findString(String expr)(Code)(Java Doc) protected String findString(String expr, String field, String errorMsg)(Code)(Java Doc) protected Object findValue(String expr)(Code)(Java Doc) protected Object findValue(String expr, String field, String errorMsg)(Code)(Java Doc) protected Object findValue(String expr, Class toType)(Code)(Java Doc) public Stack getComponentStack()(Code)(Java Doc) public String getId()(Code)(Java Doc) public Map getParameters()(Code)(Java Doc) public OgnlValueStack getStack()(Code)(Java Doc) protected void popComponentStack()(Code)(Java Doc) public void setId(String id)(Code)(Java Doc) public boolean start(Writer writer)(Code)(Java Doc) protected String toString(Throwable t)(Code)(Java Doc) public boolean usesBody()(Code)(Java Doc)
|
|
|