PDA

View Full Version : Form in a Tabpanel



Stephan123
12 Aug 2009, 6:01 AM
Hello !

I have an form in a tabpanel.
The tabpanel has 3 tabs.
In 'tab1' and 'tab3' i use the same form.
When i switch between the tabs i see something an incomplete form.


var fenster = new Ext.Window({
title: 'Domainverwaltung',
renderTo: Ext.getBody(),
y: 100,
x: 350,
closable: true,
id: 'fenster',
width: 610,
resizable: false,
// autoHeight: true,
iconCls: 'modul_domain',
items : new Ext.TabPanel({
autoTabs: true,
activeTab: 0,
deferredRender: false,
// shadow: true,
// LayoutOnTabChange: true,
border: false,
id: 'tabpanel',
items: [{
title: 'vorhandene Domain',
id: 'abschnitt1'
},{
title : "Domain bearbeiten",
id: 'abschnitt2'
},{
title : "neue Domain",
id: 'abschnitt3'
}],
listeners:{
tabchange: function(tab){

/*** wenn 'abschnitt1' aktiv ist ***/
if(tab.activeTab.id == 'abschnitt1'){

// 'abschnitt2' abschalten
Ext.getCmp('tabpanel').getItem('abschnitt2').disable();
}

/*** wenn 'abschnitt3' aktiv ist ***/
if(tab.activeTab.id == 'abschnitt3'){

Ext.getCmp('tabpanel').getItem('abschnitt2').disable();
modul.neueDomainAnlegen();
}


}
}
}) // Ende Tabpanel
}); // Ende des Fenster

// anzeigen Fenster
fenster.show();

Any idee ?

Stephan

tryanDLS
12 Aug 2009, 6:06 AM
http://extjs.com/learn/Ext_Forum_Help#How_to_post_code_properly

I don't see any Forms in the code you posted. You can't have the same Form in 2 different panels unless you're creating them separately with unique ids.

Animal
12 Aug 2009, 6:45 AM
Window is a Container. Like all Containers, you must think about layout

http://extjs.com/deploy/ext-3.0.0/docs/?class=Ext.Container

Stephan123
13 Aug 2009, 12:36 AM
Hello !

Here are 2 snapshots from the problem.
I have an tabpanel with 3 tabs.
In 'tab nr. 2' and 'tab nr. 3' i will use the equal form.
The form has in the panels an different id.


When i call tab 2 the form is correct. (normal.jpg)
But when i call the tab 3 the form is destroyed. (error.jpg)

I use for this work the equal functions to build the form.

In the first time i have test the 2 options in the tabpanel.
This are


deferredRender: false,
LayoutOnTabChange: true,

I think the rendering from the tabpanel is to fast.
It's not enough time to rendering the second form.


Greetings Stephan

Stephan123
13 Aug 2009, 2:34 AM
In my example all fields ot the form has an 'id:' .
When i kill the id's it works.

I think it's an problem for ExtJS when an form is used in many tabs
in the tabpanel and the form elements have the same id's.


Stephan

Animal
13 Aug 2009, 3:48 AM
In my example all fields ot the form has an 'id:' .
When i kill the id's it works.

I think it's an problem for ExtJS when an form is used in many tabs
in the tabpanel and the form elements have the same id's.


Stephan

IDs must be unique. It's how Components are identified.