Better support radio inputs in bindProperty and config forms actions.
Review Request #6160 — Created July 28, 2014 and submitted — Latest diff uploaded
$.fn.bindProperty()
now accepts aradioValue
option. If set, this
will manage standard radio behavior between radio input elements and
a model property. Each input is expected to havebindProperty()
called
on it, passing aradioValue
corresponding to the appropriate value in
the model's property.When the element's property (which is expected to be a boolean) changes
to true, the model's property will be set to theradioValue
. Otherwise,
to prevent conflicts, nothing will be set on the model (with the
expectation being that anotherbindProperty()
will handle the radio
input that's now checked).When the model's property changes, the value will be compared against
theradioValue
. If they match, the radio input will be checked.The new radio action support for config form list items now support
taking aradioValue
, which is then passed tobindProperty
.
Made use of this in a change to associate multiple radio inputs with a
single model property. Verified that the element and model always had
matching states.Added new unit tests, which pass.