View Full Version : How to set a radio group in a FormPanel with setValue?

20 Oct 2010, 10:33 AM
I have a FormPanel with different components and a group of radio components. Then i have a json file which I load, decode and use via 'setValue' to set the components within the FormPanel. This works fine except for the radiogroup. What did I miss?

The panel:

var thisPanel = new Ext.form.FormPanel({
items: [{
xtype: 'fieldset',
title: 'this is the title',
defaults: {xtype: 'radio', name: 'forms'},
items: [
{label: 'label1', inputValue: 'form0'},
{label: 'label2', inputValue: 'form1'},
{label: 'label3', inputValue: 'form2'}
The json file I load:

"forms": "form1"
Now I do 'thisPanel.setValues(jsonObj)' but the third component gets checked not the second. I do that 'onCardSwitch' and when I leave the card again I do 'obj = thisPanel.getValues()'. If I trace 'obj.forms' I get the value of the radio component I selected. But how can I set the radio group via 'setValue' with my object?

Thanks in advance ...