PDA

View Full Version : [DUP][3.??] radiogroup with names like "form[radio]" creates an error



SimonSimCity
8 Jan 2010, 3:24 AM
I don't know how many other form-elements are affected by this error ...

This bug has been found in Ext 3.0.0

If you have a form with a radiogroup like the following example and the blur-function is called you'll get the following message into your javascript-error-output (copied from Opera10.10):


Unhandled exception: "Error parsing selector, parsing failed at "]""
Unhandled exception: "Error parsing selector, parsing failed at "]""
Unhandled exception: "Error parsing selector, parsing failed at ""]:checked""


Example

new Ext.form.RadioGroup({
labelWidth: 140, // label settings here cascade unless overridden
fieldLabel: 'Is this article visible ?',
defaults: {
name: 'article[is_visible]',
boxMinWidth: 100,
listeners: {
blur: function ( cObj ) {
Ext.MessageBox.alert( cObj.getGroupValue() );
}
}
},

items: [
{ boxLabel: Ext.MessageBox.buttonText.yes, checked: true, inputValue: 'yes'},
{ boxLabel: Ext.MessageBox.buttonText.no, checked: false, inputValue: 'no' }
]
});

If I debug my code I'd come to the function "Ext.form.Radio.getGroupValue()" to the line where you want to set the var "p".

In my example this var is filled by the following function:

p.child('input[name='+'article[is_visible]'+']:checked', true);
And as you can see in the error-log - he can't find an item by using the searchString "input[name=article[is_visible]]:checked".

Condor
8 Jan 2010, 3:26 AM
Duplicate of this bugreport (http://www.extjs.com/forum/showthread.php?p=210602#post210602) (includes suggested patch).