PDA

View Full Version : duplicate radiofield and getvalue



nicolabaldo
6 Jul 2017, 6:22 AM
Ext.application({
name : 'Fiddle',


launch : function() {
Ext.create('Ext.window.Window', {
title: 'Hello',
height: 400,
width: 400,
layout: 'vbox',
items: [
{
xtype: 'button',
text: 'get value radio',
handler: function(button) {
alert(Ext.getCmp('first').getValue()['stampaOre']);
}
},
{
xtype: 'radiogroup',
id: 'first',
fieldLabel: 'first',
items: [
{
boxLabel: 'SESSANTESIMI',
formId: 'a-form',
name: 'stampaOre',
cls: 'cbaLabel',
inputValue: 'T',
checked: true
},
{
boxLabel: 'CENTESIMI',
formId: 'a-form',
name: 'stampaOre',
cls: 'cbaLabel',
inputValue: 'F'
}
]
}
]
}).show();

Ext.create('Ext.window.Window', {
title: 'Hello',
height: 400,
width: 400,
layout: 'vbox',
items: [
{
xtype: 'radiogroup',
id: 'second',
fieldLabel: 'second',
items: [
{
boxLabel: 'SESSANTESIMI',
formId: 'b-form',
name: 'stampaOre',
cls: 'cbaLabel',
inputValue: 'T',
checked: true
},
{
boxLabel: 'CENTESIMI',
formId: 'b-form',
name: 'stampaOre',
cls: 'cbaLabel',
inputValue: 'F'
}
]
}
]
}).show();
}
});


See the example.
Try to click to the button and the value of first radiofield is wrong.
I expect the value 'T'.

If check then value "inSessantesimi" and check another time the button the value is correct.

nicolabaldo
6 Jul 2017, 6:40 AM
This happens with ExtJS. 6.2 and with ExtJS 5.1.2 works!