Class RadioButtonTag

  • All Implemented Interfaces:
    ConditionalTag, IconSupport, org.apache.commons.jelly.Tag

    public class RadioButtonTag
    extends PushButtonTag

    A specific input component tag for creating a radio button.

    Radio buttons are simple input components that allow to enter a boolean value: They can either be selected or deselected. Typically radio buttons are grouped together in a radio group, and then only one button of the group can be selected. To achieve this behavior, the radio buttons must be added to a radio group (by either nesting the radio button tags inside a RadioGroupTag or by specifying the groups attribute. Per default it is assumed that a radio button belongs to a group, so the noField attribute is set to true. If it is desired that a field handler is created for the radio button, noField must be set to false explicitly.

    Radio buttons can have a label text and be associated with an icon. The following attributes are supported by this tag handler class (in addition to the default attributes allowed for all input component tags):

    Attribute Description Optional
    text With this attribute the label's text can directly be set. yes
    textres Defines the resource ID for the label's text. The real text is resolved using the current resource manager and the current locale. yes
    resgrp Specifies the resource group of the label's text. If set, this resource group is used when resolving the label's text as defined by the textres attribute. If undefined, the form builder's default resource group will be used. yes
    alignment Defines the relative position of the label's icon to its text. This can be one of the literal names of the TextIconAlignment class. yes
    mnemonic Here a mnemonic for this label can be specified. If the user enters this key, the associated component will be focused (if supported by the platform). yes
    mnemonicres This attribute defines the mnemonic as a resource, which makes sense for i18n applications. yes

    This tag supports an icon, which can be defined by an IconTag in the tag's body. If neither a text nor an icon are defined, an exception will be thrown.

    Version:
    $Id: RadioButtonTag.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • RadioButtonTag

        public RadioButtonTag()
        Creates a new instance of RadioButtonTag.