View Full Version : Handle RadioGroup value transparently

22 Dec 2010, 1:49 PM
When using BasicForm.loadRecord I cannot get meaningful values from using a radiogroup. The value is always "on". The checkbox group looks like this:

xtype: 'radiogroup',
fieldLabel: 'Date format',
name: 'dateFormat',
columns: 1,
defaults: {
name: 'dateFormat-option'
items: [{
boxLabel: 'US (mm-dd-yyyy)', value: 'm-d-Y', checked: true
boxLabel: 'EUR (dd-mm-yyyy)', value: 'd-m-Y', checked: false
boxLabel: 'ISO (yyyy-mm-dd)', value: 'Y-m-d', checked: false

Mind though, that suggestions on how to fetch the value are not really useful. The goal is to have the value properly loaded into a record when using BasicForm's "loadRecord".

22 Dec 2010, 2:59 PM
show us the actual parameters sent to loadRecord.

23 Dec 2010, 12:17 AM
It's a record, how is that going to help? You're saying this is not normal behaviour of RadioGroup?

23 Dec 2010, 12:26 AM
Your radios need an inputValue instead of a value!

23 Dec 2010, 12:48 AM
That does the trick, thank you very much. Why this inconsistency though? What purpose does "value" as inherited by Field serve?

23 Dec 2010, 1:15 AM
For checkboxes and radios 'value' can be true of false (same as 'checked').

23 Dec 2010, 1:26 AM
Hmokay, that doesn't make much sense considering radios are never used as single elements. Makes sense for checkboxes, not radios. Anyway, thanks again.