Class 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 return a value similar to the key of the getGenders() map if that particular gender is to be selected.

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

 
 <@s.radio name="car" list={"ford": "Ford Motor Co", "toyota": "Toyota"} listKey="key" listValue="value" />
 
 
  • Field Details

  • Constructor Details

    • Radio

      public Radio(ValueStack stack, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
  • Method Details

    • getDefaultTemplate

      protected String getDefaultTemplate()
      Description copied from class: UIBean
      A contract that requires each concrete UI Tag to specify which template should be used as a default. For example, the CheckboxTab might return "checkbox.vm" while the RadioTag might return "radio.vm". This value not begin with a '/' unless you intend to make the path absolute rather than relative to the current theme.
      Specified by:
      getDefaultTemplate in class UIBean
      Returns:
      The name of the template to be used as the default.
    • lazyEvaluation

      protected boolean lazyEvaluation()
      Radio tag requires lazy evaluation as list of tags is dynamically generated using <s:iterator/>
      Overrides:
      lazyEvaluation in class UIBean
      Returns:
      boolean true by default