Results 1 to 2 of 2

Thread: Error: formpanel , tabpanel and formpanel again

  1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    3
    Vote Rating
    0
      0  

    Default Error: formpanel , tabpanel and formpanel again

    well, if you first create a formpanel, and load a tabpanel in its items. At the same time, you new another formpanel, and add it to the tab ot this tabpanel. You can find there is no export in the tab of tabpanel. My code is below. If you chage the red color char to Panel or Window, everything is OK.

    Code:
    test = {
        dataRecord: ['text'],
        urlSave: 'tabpanel.html',
    
        createDialog: function() {
    
            var reader = new Ext.data.JsonReader({}, this.dataRecord);
            this.formPanel = new Ext.form.FormPanel({
                defaultType: 'textfield',
                labelAlign: 'right',
                labelWidth: 70,
                frame: true,
                autoScroll: true,
                title: '????',
                reader: reader,
                url: this.urlSave,
                items: [{
                    xtype: 'hidden',
                    name: 'id'
                },{
                    fieldLabel: '?      ?',
                    //readOnly:true,
                    name: 'name',
                    allowBlank: false,
                    width: 200
                }],
                buttons: [{
                    text: '??',
                    handler: function() {
                        if (this.formPanel.getForm().isValid()) {
                            this.formPanel.getForm().submit({
                                waitTitle: "???",
                                waitMsg : '????????...',
                                success: function() {
                                    this.dialog.hide();
                                    this.refresh();
                                },
                                failure: function() {
                                },
                                scope: this
                            });
                        }
                    }.createDelegate(this)
                },{
                    text: '??',
                    handler: function() {
                        this.dialog.hide();
                    }.createDelegate(this)
                }]
            });
    
            var tabs = new Ext.TabPanel({
                title:'tab',
                //renderTo: document.body,
                height: 500
            });
    
            tabs.add({
                title: '????',
                // html: 'http://#'
                deferredRender:false,
                items:[this.formPanel]
            });
            tabs.add({
                title: '????',
                html: '??2'
                // closable: true
            });
    
            tabs.activate(0);
    
            this.dialog = new Ext.form.FormPanel({
                layout: 'fit',
                width: this.dlgWidth ? this.dlgWidth : 400,
                height: this.dlgHeight ? this.dlgHeight : 400,
                //closeAction: 'hide',
                items: [tabs]
            });
        }
    };
    
    
    Ext.onReady(function(){
    
        test.createDialog();
        test.dialog.render(document.body);
    
    });
    Last edited by evant; 29 Jun 2009 at 12:15 AM. Reason: Please put code in [code][/code] tags

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,608
    Vote Rating
    874
      0  

    Default

    You can't nest forms inside forms. If you have:

    Code:
    FormPanel
         TabPanel
              FormPanel
    You're going to end up with nested form tags.
    Evan Trimboli
    Twitter - @evantrimboli

Posting Permissions

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