PDA

View Full Version : FormPanel into TabPanel



luca.santaniello
11 Feb 2010, 5:39 AM
Hi,

I want insert my FormPanel into my TabPanel but i get this error:

this.body is null
ext-all.js
Row: 7

I have a panel that contains my TabPanel



var myField = new Ext.form.Field({
fieldLabel: 'my field',
width: 150,
value: ''
});

var myField2 = new Ext.form.Field({
fieldLabel: 'my field 2',
width: 150,
value: ''
});

var myTab = new Ext.FormPanel({
id: 'myTab',
title: 'MyTab1',
items: [
myField, this.pindirizzo
]
});


var myTab2 = new Ext.FormPanel({
id: 'myTab2',
title: 'MyTab2'
});

var tabs = new Ext.TabPanel({
activeTab: 0,
frame:true,
height: 200,
items:[
myTab, myTab2
]
});


I define renderTo: Ext.getBody() in tabs object, it run correctly, but I must add my tabPanel into other extended Panel...



MyComp = Ext.extend(Ext.FormPanel,
{
constructor: function(config)
{
....
Ext.apply(this,
{
items : [
tabs,
...
]
});
}
}


If I do it, i get error!

Can you help me please?

Thanks

rbastic
11 Feb 2010, 6:07 AM
Why can't you just add the tabpanel directly to the formpanel?

Shouldn't really be a need for another extended panel.

Also, not sure if this still applies for Ext 3, but in Ext 2, you couldn't put a formpanel within another formpanel -- so if that's what you're actually trying to do, it won't work.