Results 1 to 6 of 6

Thread: Ext.form.FieldSet title cannot be overwritten by setTitle()

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3137 in a recent build.
  1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    20
    Vote Rating
    1
      0  

    Default Ext.form.FieldSet title cannot be overwritten by setTitle()

    REQUIRED INFORMATION

    Sencha Touch version tested:

    • Sencha Touch 2.0.2
    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:
    • none
    Possible fix:
    • not provided
    Operating System:
    • Linux

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,335
    Vote Rating
    1297
      0  

    Default

    Thank you for the report. Looks like the Ext.Title component isn't getting instantiated due the the if in Ext.factory method.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2011
    Posts
    20
    Vote Rating
    1
      0  

    Default

    Same thing happens on buttons / setText()!

    Kind of a "workaround" to suppress the error:
    Code:
    if(!this.getMyElement().getText())
        this.getMyElement().setText('foobar');

  4. #4
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,159
    Vote Rating
    7
      0  

    Default

    Fixed for the next beta of 2.1. Thanks.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Location
    Eindhoven, Netherlands
    Posts
    32
    Vote Rating
    2
      0  

    Default 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 ....

  6. #6
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,335
    Vote Rating
    1297
      0  

    Default

    I can confirm this is working in the code for 2.1.0 b2 not b1 as someone marked it as fixed in.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •