RadioGroupBinding
Defined in: RadioGroupBinding.ts:6, RadioGroupBinding.ts:57
Binding for a group of radio buttons
Key features:
- Binds a radio button per option, grouped by name
- Types the options after the getter, and passes the option itself to the setter
- Supports optional (nullable) values, including a
nulloption - Manages error states and ARIA attributes
Type Parameters
Section titled “Type Parameters”V extends RadioGroupBinding.Option = RadioGroupBinding.Option
Implements
Section titled “Implements”FormBinding
ButtonConfig
Section titled “ButtonConfig”ButtonConfig =
object
Defined in: RadioGroupBinding.ts:34
Overrides for one radio button of the group
optionalid?:string|boolean
Defined in: RadioGroupBinding.ts:42
[Override] ID of the input element.
true: Use the field's stable ID as the ID.false: No ID.string: Use the given string as the ID.
optionalname?:string
Defined in: RadioGroupBinding.ts:44
[Override] Name attribute of the input element
Config
Section titled “Config”Config<
V> =object
Defined in: RadioGroupBinding.ts:19
Type Parameters
Section titled “Type Parameters”V extends RadioGroupBinding.Option = RadioGroupBinding.Option
aria-describedby?
Section titled “aria-describedby?”
optionalaria-describedby?:Attrs["aria-describedby"]
Defined in: RadioGroupBinding.ts:30
[Extend] IDs of the elements describing the radio buttons; the ID of the error text is added while errors are reported
getter
Section titled “getter”getter: () =>
V
Defined in: RadioGroupBinding.ts:21
Get the value from the model
Returns
Section titled “Returns”V
onChange?
Section titled “onChange?”
optionalonChange?:Attrs["onChange"]
Defined in: RadioGroupBinding.ts:26
[Extend] Change handler
onFocus?
Section titled “onFocus?”
optionalonFocus?:Attrs["onFocus"]
Defined in: RadioGroupBinding.ts:28
[Extend] Focus handler
setter
Section titled “setter”setter: (
value:V) =>void
Defined in: RadioGroupBinding.ts:23
@action
Set the option of the selected radio button to the model
Parameters
Section titled “Parameters”V
Returns
Section titled “Returns”void
Option
Section titled “Option”Option =
string|number|boolean|null
Defined in: RadioGroupBinding.ts:17
Value that a radio button of the group stands for
Remarks
Section titled “Remarks”The button's value attribute is its string form, or an empty string for null.
Constructor
Section titled “Constructor”new RadioGroupBinding<
V>(field,config):RadioGroupBinding<V>
Defined in: RadioGroupBinding.ts:60
Parameters
Section titled “Parameters”FormField
config
Section titled “config”Returns
Section titled “Returns”RadioGroupBinding<V>
Members
Section titled “Members”config
Section titled “config”config:
RadioGroupBinding.Config<V>
Defined in: RadioGroupBinding.ts:62
Implementation of
Section titled “Implementation of”FormBinding.config
onFocus
Section titled “onFocus”onFocus:
FocusEventHandler<HTMLInputElement>
Defined in: RadioGroupBinding.ts:71
errorMessages
Section titled “errorMessages”Get Signature
Section titled “Get Signature”get errorMessages():
string|null
Defined in: RadioGroupBinding.ts:77
Returns
Section titled “Returns”string | null
@computed
Get Signature
Section titled “Get Signature”get value():
V
Defined in: RadioGroupBinding.ts:67
Returns
Section titled “Returns”V
props()
Section titled “props()”props(
option,config?):object
Defined in: RadioGroupBinding.ts:82
Parameters
Section titled “Parameters”option
Section titled “option”V
Option that the radio button stands for
config?
Section titled “config?”RadioGroupBinding.ButtonConfig
Returns
Section titled “Returns”object
aria-describedby
Section titled “aria-describedby”aria-describedby:
string|undefined
aria-errormessage
Section titled “aria-errormessage”aria-errormessage:
string|undefined
aria-invalid
Section titled “aria-invalid”aria-invalid:
boolean|undefined
checked
Section titled “checked”checked:
boolean
id:
string|undefined
name:
string
onChange
Section titled “onChange”onChange:
ChangeEventHandler<HTMLInputElement,HTMLInputElement>
onFocus
Section titled “onFocus”onFocus:
FocusEventHandler<HTMLInputElement>
type:
"radio"="radio"
value:
string
Implementation of
Section titled “Implementation of”FormBinding.props