FileDocCategorySizeDatePackage
Radio.javaAPI DocExample2558Mon Jul 23 13:26:36 BST 2007org.apache.struts2.components

Radio

public class Radio extends ListUIBean
Render a radio button input field.

Examples

In this example, a radio control is displayed with a list of genders. The gender list is built from attribute id=genders. The framework calls getGenders() which will return a Map. For examples using listKey and listValue attributes, see the section select tag. The default selected one will be determined (in this case) by the getMale() method in the action class which should retun a value similar to the key of the getGenters() map if that particular gender is to be selected.


<s:action name="GenderMap" id="genders"/>
<s:radio label="Gender" name="male" list="#genders.genders"/>

Fields Summary
public static final String
TEMPLATE
Constructors Summary
public Radio(com.opensymphony.xwork2.util.ValueStack stack, HttpServletRequest request, HttpServletResponse response)


           
        super(stack, request, response);
    
Methods Summary
protected java.lang.StringgetDefaultTemplate()

        return TEMPLATE;