PDA

View Full Version : radio value from xmlreader



iMacX
14 Oct 2009, 8:58 AM
Hi,

I would like to set the value of a radio button inside a radiogroup with tha value from an xml reader, but my radio button is never checked.

My xmlreader (a part of it):


reader : new Ext.data.XmlReader({
record : 'asset', // Record name
id: "assetId", // ID for the record
success: '@success'
}, ['name', 'defaultImage']),

My radio group:

{
xtype: 'radiogroup',
fieldLabel: '<spring:message code="asset.defaultImage"/>',
items: [
{boxLabel: '<spring:message code="asset.frontImage"/>', name: 'defaultImage', inputValue: 1,
listeners: {
'check':{
fn: function(checkbox, checked){
if (checked){
viewAssetFile('img','frontImage');
}
}
}
}
},
{boxLabel: '<spring:message code="asset.sideImage"/>', name: 'defaultImage', inputValue: 2,
listeners: {
'check':{
fn: function(checkbox, checked){
if (checked){
viewAssetFile('img','sideImage');
}
}
}
}
},
{boxLabel: '<spring:message code="asset.bottomImage"/>', name: 'defaultImage', inputValue: 3,
listeners: {
'check':{
fn: function(checkbox, checked){
if (checked){
viewAssetFile('img','bottomImage');
}
}
}
}
},
{boxLabel: '<spring:message code="asset.topImage"/>', name: 'defaultImage', inputValue: 4,
listeners: {
'check':{
fn: function(checkbox, checked){
if (checked){
viewAssetFile('img','topImage');
}
}
}
}
}
]
}

The value returned from the database is for example 1 but the radio with inputValue: 1 is not checked.

How I have to do,

Thx a million!