1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Brasil
    Posts
    6
    Vote Rating
    0
    victorvidigal is on a distinguished road

      0  

    Default Unanswered: set an id to tabpanel

    Unanswered: set an id to tabpanel


    Hello,
    I'm trying to set an specifi id to tabpanel but I can't do it.
    I try to find a componente with name tabEndereco in firebug but there is no exists.

    I need a specific id to build tests with selenium.

    can somebody help me?

    This is my code:
    Code:
            return formPerfil = Ext.create('Ext.form.Panel', {
                bodyStyle: 'padding:5px',
                id: 'formPerfil',
                fieldDefaults: {
                    labelAlign: 'top',
                    msgTarget: 'side'
                },
                layout: 'fit',
                defaults: {
                    anchor: '95%'
                },
                items: [{
                    layout: 'column',
                    border: false,
                    items: [{
                        columnWidth: .5,
                        border: false,
                        layout: 'anchor',
                        defaultType: 'textfield',
                        items: [{
                            fieldLabel: 'Nome',
                            id: 'tfNome',
                            name: 'tfNome',
                            value: vNome,
                            width: 200,
                            labelWidth: 37,
                            maxLength: 150,
                            allowBlank: false
                        }]
                    }, {
                        columnWidth: .5,
                        border: false,
                        layout: 'anchor',
                        defaultType: 'textfield',
                        items: [{
                            fieldLabel: 'Sobrenome',
                            value: vSobrenome,
                            id: 'tfSobrenome',
                            name: 'tfSobrenome',
                            maxLength: 150,
                            width: 250,
                            labelWidth: 70,
                            allowBlank: false
                        }]
                    }]
                }, {
                    xtype: 'tabpanel',
                    id: 'tabpanel',
                    itemId: 'tabpanel',
                    plain: true,
                    activeTab: 0,
                    height: 230,
                    defaults: {
                        bodyStyle: 'padding:10px'
                    },
                    items: [{
                        title: 'Endere├žo',
                        layout: 'column',
                        border: false,
                        itemId: 'tabEndereco',
                        items: [{
                            columnWidth: .4,
                            border: false,
                            layout: 'anchor',
                            defaultType: 'textfield',
                            itemId: 'tabEndereco',
                            items: [{
                                value: vLogradouro,
                                id: 'tfLogradouro',
                                name: 'tfLogradouro',
                                width: 250,
                                labelWidth: 70,
                                maxLength: 150,
                                fieldLabel: 'Logradouro',
                                allowBlank: true
                            }

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,680
    Answers
    130
    Vote Rating
    112
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default


    you are mixing id and itemId. i hope you are aware of the difference, if not take a look into the api docs.

    Code:
    Ext.getCmp('tabpanel').getComponent('tabEndereco');
    Best regards
    Tobias Uhlig
    __________

    S-CIRCLES Social Network Engine

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Location
    Brasil
    Posts
    6
    Vote Rating
    0
    victorvidigal is on a distinguished road

      0  

    Default set an id to tabpanel

    set an id to tabpanel


    Thank's but my problem isn't get components by id.
    My problem is that tabs of tabpanel are not with defined id. For example, if I look at page code (firebug) there aren't components with id tabEndereco.
    I tried use only id or only itemId.

  4. #4
    Sencha User
    Join Date
    Jan 2008
    Location
    Brazil
    Posts
    1
    Vote Rating
    0
    manso is on a distinguished road

      0  

    Default


    I don't understand why the id of the component does not appear in the firebug

  5. #5
    Sencha User
    Join Date
    Dec 2009
    Location
    Enschede, The Netherlands
    Posts
    327
    Answers
    16
    Vote Rating
    13
    flanders will become famous soon enough

      0  

    Default


    You cannot find the id 'tabEndereco', because you are not specifying it. However, you are specifying an itemId 'tabEndereco' twice. (Which is valid because it is in two different collections).

    Tobias was right pointing you to the difference between id and itemId
    http://docs.sencha.com/ext-js/4-0/#!...mponent-cfg-id

  6. #6
    Sencha User
    Join Date
    Nov 2011
    Location
    Brasil
    Posts
    6
    Vote Rating
    0
    victorvidigal is on a distinguished road

      0  

    Default set an id to tabpanel

    set an id to tabpanel


    thank's
    it's allright now.


    Code:
                    xtype: 'tabpanel',
                    id: 'tabpanel',
                    plain: true,
                    activeTab: 0,
                    height: 230,
                    defaults: {
                        bodyStyle: 'padding:10px'
                    },
                    items: [{
                        title: 'Endere├žo',
                        layout: 'column',
                        border: false,
                        id: 'tabEndereco',
                        items: [{
                            columnWidth: .4,
                            border: false,
                            layout: 'anchor',
                            defaultType: 'textfield',
                            items: [{
                                value: vLogradouro,
                                id: 'tfLogradouro',
                                name: 'tfLogradouro',
                                width: 250,
                                labelWidth: 70,
                                maxLength: 150,
                                fieldLabel: 'Logradouro',
                                allowBlank: true

Thread Participants: 3

Tags for this Thread