| java.lang.Object com.opensymphony.webwork.components.Component com.opensymphony.webwork.components.UIBean com.opensymphony.webwork.components.ListUIBean com.opensymphony.webwork.components.CheckboxList
CheckboxList | public class CheckboxList extends ListUIBean (Code) | |
Creates a series of checkboxes from a list. Setup is like <ww:select /> or <ww:radio />, but creates checkbox tags.
Examples
<ww:checkboxlist name="foo" list="bar"/>
It is possible to select multiple checkboxes, by handling a List into the value attribute.
The List passed into the value attribute could be :-
- key if the list attribute is passed in is a Map
- listKey properties if listKey attribute is used
- entry/entries passed into the list attribute
<ww:checkboxlist name="options"
list="%{#{'FOO':'foo','BAR':'bar','BAZ':'baz','BOO':'boo'}}"
value="%{{'FOO','BAZ'}}" />
<ww:checkboxlist name="options"
list="%{{'Foo','Bar','Baz'}}"
value="%{{'Foo','Bar'}}" />
public class MyAction extends ActionSupport {
public List<Choice> getChoices() {
....
}
....
public List<String> getPreSelectedChoices() {
// returns a list of Choice.getKey(), which is a String
....
}
}
public class Choice {
public String getKey() { ...}
public String getDisplayName() { ... }
....
}
<ww:checkboxlist name="myChoice"
list="%{choices}"
listKey="%{'key'}"
listValue="%{'displayName'}"
value="%{preSelectedChoices}" />
author: Patrick Lightbody author: Rene Gielen version: $Revision: 2746 $ since: 2.2 |
getDefaultTemplate | protected String getDefaultTemplate()(Code) | | |
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)
|
|
|