Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-2955
in
a recent build.
-
Sencha User
Fieldset RadioField getGroupValue
I have been working on a view whereby I have grouped checkboxes and have tried to get the value of the checked item upon clicking the submit button. I always received the return value of true so I decided to try the example on my version (2.0.1). I have found that this approach no longer works as described in this example as it still only returns "true" and not the actual value. Can someone point me in the right direction or is this a bug in the new release?
http://senchaexamples.com/2012/03/13...encha-touch-2/
Code:
Ext.create('Ext.form.Panel', {
fullscreen : true,
items : [
{
xtype : 'toolbar',
docked : 'top',
items : [
{
text : 'get checked',
handler : function () {
var products = Ext.ComponentQuery.query('radiofield[name=product]');
Ext.Msg.alert('getGroupValue()', products[0].getGroupValue());
}
}
]
},
{
xtype : 'fieldset',
title : 'Products:',
instructions : 'Please select a product.',
defaults : {
labelWidth : 180
},
items : [
{
xtype : 'radiofield',
name : 'product',
label : 'Ext JS',
value : 'extjs'
},
{
xtype : 'radiofield',
name : 'product',
label : 'Sencha Touch',
value : 'senchatouch',
checked : true
},
{
xtype : 'radiofield',
name : 'product',
label : 'Sencha Designer',
value : 'designer'
}
]
}
]
});
-
The real issue is the getValue method returning true or null on the radio instead of the value config.
-
Sencha User
I took a look at the code base and yes...you are correct. The getGroupValue does call the getValue. With that, if the value is set to "extjs" as per the example I posted then why is the getValue call returning true? More specifically, you can go to the link I posted and see that the return value there is accurate and that begs the question of what is the difference in implementation between 2.0.0 (what the example is running on) and 2.0.1 (what I am)?
-
Sencha User
@Mitchell...is there some kind of cryptic answer in your response or are you agreeing that this is a bug?
-
Look at the top, this bug has been open since I replied.
-
Sencha User
Ok...I am new to these forums so I didn't see it. So was this working in 2.0.0?
-
Sencha User
So...was 2.0.1 not tested or what. I found another potential bug in the following panel.
Basic fieldset and I want to call the getTitle() method to retrieve the value of the fieldset title. Instead of returning the value like the documentation states it returns an entire class.
From Chrome Console
Ext.getCmp('pets').getTitle()
Ext.apply.create.Class
- _baseCls: "x-form-fieldset-title"
- _disabledCls: "x-item-disabled"
- _docked: "top"
- _html: "Do you have pets?"
- _itemId: "ext-title-3"
- _title: "Do you have pets?"
- config: Ext.Object.classify.objectClass
- element: Ext.apply.create.Class
- eventDispatcher: Ext.apply.create.Class
- getEventDispatcher: function () {
- getId: function () {
- getObservableId: function () {
- getUniqueId: function () {
- id: "ext-title-3"
- initConfig: function (){}
- initialConfig: Object
- initialized: true
- innerElement: Ext.apply.create.Class
- innerHtmlElement: Ext.apply.create.Class
- observableId: "#ext-title-3"
- onInitializedListeners: Array[0]
- parent: Ext.apply.create.Class
- referenceList: Array[1]
- renderElement: Ext.apply.create.Class
- rendered: true
- __proto__: TemplateClass
Ext.define('Maint.view.Test', {
extend: 'Ext.form.Panel',
xtype: 'newformtest',
id: 'newformtest',
requires: [
'Ext.field.Radio',
],
config: {
fullscreen: true,
title: 'New Request',
items: [
{
xtype: 'fieldset',
id: 'pets',
title: 'Do you have pets?',
defaults: {
xtype : 'radiofield',
labelWidth: '35%'
},
items: [
{
name : 'pet',
value: 'hellyeah',
label: 'Yes',
},
{
name : 'pet',
value: 'hellno',
label: 'No',
}
]
},
{
xtype: 'button',
ui: 'round',
text: 'Submit',
id: 'submitbutton'
},
]
}
});
-
Ext JS Premium Member
It would be nice if you guys would put a radio.getGroupValue() call/unit test into the Kitchen Sink. I remember this breaking for a while in Sencha 1.x as well. I searched the entire Sencha examples folder for getGroupValue and came up with nothing. If you never use it or test it, it's a lot easier to break it I'm guessing.
-
Sencha User
Perhaps this is just an old bug, but I cannot replicate this in the latest SDK. I've added unit tests for this functionality so if it ever breaks again, we will know.
Thanks.
-
20 Aug 2012, 10:45 AM
#10
Sencha User

Originally Posted by
admiralman
So...was 2.0.1 not tested or what. I found another potential bug in the following panel.
Basic fieldset and I want to call the getTitle() method to retrieve the value of the fieldset title. Instead of returning the value like the documentation states it returns an entire class.
This is also working, but I've added a unit test for it anyway.