01: package com.opensymphony.webwork.components;
02:
03: import com.opensymphony.xwork.util.OgnlValueStack;
04:
05: import javax.servlet.http.HttpServletRequest;
06: import javax.servlet.http.HttpServletResponse;
07:
08: /**
09: * <!-- START SNIPPET: javadoc -->
10: * Render a radio button input field.</p>
11: * <!-- END SNIPPET: javadoc -->
12: *
13: * <p/> <b>Examples</b>
14: * <p/>
15: * <!-- START SNIPPET: exdescription -->
16: * In this example, a radio control is displayed with a list of genders. The gender list is built from attribute
17: * id=genders. WW calls getGenders() which will return a Map. For examples using listKey and listValue attributes,
18: * see the section select tag. The default selected one will be determined (in this case) by the getMale() method
19: * in the action class which should retun a value similar to the key of the getGenters() map if that particular
20: * gender is to be selected.<p/>
21: * <!-- END SNIPPET: exdescription -->
22: * <pre>
23: * <!-- START SNIPPET: example -->
24: * <ww:action name="GenderMap" id="genders"/>
25: * <ww:radio label="Gender" name="male" list="#genders.genders"/>
26: * <!-- END SNIPPET: example -->
27: * </pre>
28: *
29: * @author Patrick Lightbody
30: * @author Rene Gielen
31: * @author tm_jee
32: * @version $Revision: 1577 $
33: * @since 2.2
34: *
35: * @ww.tag name="radio" tld-body-content="JSP" tld-tag-class="com.opensymphony.webwork.views.jsp.ui.RadioTag"
36: * description="Renders a radio button input field"
37: */
38: public class Radio extends ListUIBean {
39: final public static String TEMPLATE = "radiomap";
40:
41: public Radio(OgnlValueStack stack, HttpServletRequest request,
42: HttpServletResponse response) {
43: super (stack, request, response);
44: }
45:
46: protected String getDefaultTemplate() {
47: return TEMPLATE;
48: }
49: }
|