Defines the specifics of a set of options of which exactly one must be selected.
In addition to the properties and methods listed below, this component inherits properties and methods from the superclass
Component. For example, any Radio component has a
defaultValue property even though these are not explicitly listed here.
|values||Specifies the options the user can choose from. Must be an array of values where each item has the following fields:||Struct/dict|
|inline||If set to true, layout the radio buttons horizontally instead of vertically.||Boolean||False|
|labelPosition||Position of the label with respect to the radio component. Can be ||String|
|optionsLabelPosition||Position of the text of every option with respect to the radio button. Can be ||String|
|setValues||Set the labels and accompanying values. This sets the |
By using the
setValues method, the example Radio component above can be created using:
gender = component.Radio("gender_radio", form); gender.label = "Gender"; gender.setValues(["Male", "Female", "Other", "Will not say"], ... ["m", "f", "o", "wns"])
gender = component.Radio("gender_radio", form) gender.label = "Gender" gender.setValues(["Male", "Female", "Other", "Will not say"], ["m", "f", "o", "wns"])
- Use the triggerHappy functionality to trigger an event whenever the value of the Radio component is changed by the user.
- The Checkbox component allows for multiple selections at once.
- The Selectboxes lets you define a group of checkboxes in a similar fashion as the Radio component.
- The Survey component uses Radio buttons to ask several questions, each of them with the same set of possible answers.