Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3137
in
a recent build.
-
Sencha User
Ext.form.FieldSet title cannot be overwritten by setTitle()
REQUIRED INFORMATION
Sencha Touch version tested:
Browser versions tested against:
- Chrome 20.0.1123.4 dev
- Safari Version 5.1.7 (7534.57.2, r122160)
Description:
- Calling setTitle() on a FieldSet with an existing title will result in an error.
Steps to reproduce the problem:
- Create an Ext.form.FieldSet
- Set an initial title (either in config object or by setTitle() method)
- Set a new title by calling setTitle() method
The result that was expected:
- new title should be displayed
The result that occurs instead:
- TypeError: 'undefined' is not a function (evaluating 'instance.setConfig(config)')
Test Case:
Code:
Ext.application({
name: 'BugReport',
requires: [
'Ext.MessageBox',
'Ext.form.Panel',
'Ext.form.FieldSet'
],
launch: function() {
var integer = 0;
// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();
// Add elements to viewport
Ext.Viewport.add(new Ext.form.Panel({
items: [
{
xtype: 'fieldset',
id: 'fieldset',
//title: 'blah'
},
{
xtype: 'button',
text: 'set title',
handler: function() {
var title = 'foobar ' + integer;
console.log('setting title to ' + title);
Ext.getCmp('fieldset').setTitle(title);
integer++;
}
}
]
}));
},
});
HELPFUL INFORMATION
See this URL for live test case:
Debugging already done:
Possible fix:
Operating System:
-
Thank you for the report. Looks like the Ext.Title component isn't getting instantiated due the the if in Ext.factory method.
-
Sencha User
Same thing happens on buttons / setText()!
Kind of a "workaround" to suppress the error:
Code:
if(!this.getMyElement().getText())
this.getMyElement().setText('foobar');
-
Sencha User
Fixed for the next beta of 2.1. Thanks.
-
Sencha User
Still broken.
In 2.1.0-b1
comicinfofieldset.setTitle("bla");
where comicinfofieldset is configured with:
{
xtype: 'fieldset',
title: 'Comic Info',
itemId: 'comicinfofieldset',
items: [
{
xtype: 'textfield',
name: 'FilePath',
label: 'File',
readOnly: true
},
]}
generates exception:
Uncaught TypeError: Object Comic Info has no method 'setConfig'
in the call to factory() in method applyTitle of FieldSet
PS: this did work in 2.0.1.1 ....
-
I can confirm this is working in the code for 2.1.0 b2 not b1 as someone marked it as fixed in.