<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#40007f;">Hi,<br><br>I have managed to set up a viewport containing 3 mapPanels which are contained in a tab panel.<br><br>With the code below I can start the application and the grids are loaded according to which tab is activated. The problem is that I can only do it once! <br>If I change from from the first tab to the second tab....and then back to the first tab, the grid in is not activated!?!?<br><br>I´m sure there is a simple explanation...i hope. <br>Can anyone see it?<br><br>The app is here...<br><a href="http://maps.zgb.de:8080/geoserver/www/testing/wea_tabs.html">http://maps.zgb.de:8080/geoserver/www/testing/wea_tabs.html</a><br><br><br> var centerTabPanel = new Ext.TabPanel({<br>
id:'centerTabPanel',<br> region:'center',<br> width: 800, <br> activeTab: 0,<br> items:[mapPanel_wea, mapPanel_biogas, mapPanel_wasser]<br> });<br> <br> centerTabPanel.items.each(function(tab){<br>
<br> tab.on('activate',function(panel){<br> if<br> (panel.id == 'WEA') {<br> // Ext.Msg.alert('Panel', panel.id + '" tab?');<br> gridContainer.remove(grid_wasser);<br>
gridContainer.remove(grid_biogas);<br> gridContainer.add(grid_wea);<br> gridContainer.doLayout();<br> }<br> else<br> if (panel.id == 'Biogas') {<br> //
Ext.Msg.alert('Panel', panel.id + '" tab?');<br> gridContainer.remove(grid_wea);<br> gridContainer.remove(grid_wasser);<br> gridContainer.add(grid_biogas);<br> gridContainer.doLayout();<br> }<br>
else<br> if (panel.id == 'Wasserkraft') {<br> // Ext.Msg.alert('Panel', panel.id + '" tab?');<br> gridContainer.remove(grid_wea);<br> gridContainer.remove(grid_biogas);<br> gridContainer.add(grid_wasser);<br>
gridContainer.doLayout();<br> }<br> });<br> <br> });<div><br><br>Thanks for any help,<br><br>Robert<br></div>
</div></body></html>