RadioGroupBinding
Defined in: RadioGroupBinding.ts:5, RadioGroupBinding.ts:54
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:31
Overrides for one radio button of the group
optionalid?:string|boolean
Defined in: RadioGroupBinding.ts:39
[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:41
[Override] Name attribute of the input element
Config
Section titled “Config”Config<
V> =object
Defined in: RadioGroupBinding.ts:18
Type Parameters
Section titled “Type Parameters”V extends RadioGroupBinding.Option = RadioGroupBinding.Option
getter
Section titled “getter”getter: () =>
V
Defined in: RadioGroupBinding.ts:20
Get the value from the model
Returns
Section titled “Returns”V
onChange?
Section titled “onChange?”
optionalonChange?:Attrs["onChange"]
Defined in: RadioGroupBinding.ts:25
[Extend] Change handler
onFocus?
Section titled “onFocus?”
optionalonFocus?:Attrs["onFocus"]
Defined in: RadioGroupBinding.ts:27
[Extend] Focus handler
setter
Section titled “setter”setter: (
value:V) =>void
Defined in: RadioGroupBinding.ts:22
@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:16
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:57
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:59
Implementation of
Section titled “Implementation of”FormBinding.config
onFocus
Section titled “onFocus”onFocus:
FocusEventHandler<HTMLInputElement>
Defined in: RadioGroupBinding.ts:68
errorMessages
Section titled “errorMessages”Get Signature
Section titled “Get Signature”get errorMessages():
string|null
Defined in: RadioGroupBinding.ts:74
Returns
Section titled “Returns”string | null
@computed
Get Signature
Section titled “Get Signature”get value():
V
Defined in: RadioGroupBinding.ts:64
Returns
Section titled “Returns”V
props()
Section titled “props()”props(
option,config?):object
Defined in: RadioGroupBinding.ts:79
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-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