<div>I am trying to test following scenario:</div><div><br></div><div> - A Ext.Window has one gx_mappanel item; </div><div>   </div><div>   </div><div> - both Ext.Window and gx_mappanel are stored in variables;</div><div><br>

</div><div>   </div><div>   </div><div><br></div><div> - One button is to remove gx_mappanel item from Ext.Window container;</div><div><br></div><div>   </div><div><br></div><div> - The other button is to add this gx_mappanel item back to Ext.Window  </div>

<div>   container;</div><div><br></div><div>However:</div><div>    Once mappanel is removed, it cannot be added back to its container. </div><div><br></div><div>The issue happens in IE browser, and the error is:</div><div>

<br></div><div>    SCRIPT5007: Unable to get value of the property &#39;removeChild&#39;: object is null or undefined       </div><div><br></div><div>which is in OpenLayers.js, line 825 character 412:</div><div><br></div>

<div>    render: function(div) {</div><div>        this.div = OpenLayers.Util.getElement(div);</div><div>        OpenLayers.Element.addClass(this.div, &#39;olMap&#39;);</div><div>        this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);</div>

<div>        this.div.appendChild(this.viewPortDiv);</div><div>        this.updateSize();</div><div>    }</div><div>     </div><div>Codes I&#39;ve tried:</div><div><br></div><div>        &lt;! DOCTYPE HTML&gt;</div><div>
    &lt;html&gt;</div>
<div>        &lt;head&gt;</div><div>            &lt;title&gt;GeoExt MapPanel Example&lt;/title&gt;</div><div><br></div><div>        &lt;script type=&quot;text/javascript&quot; src=&quot;<a href="http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js">http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js</a>&quot;&gt;&lt;/script&gt;</div>

<div>        &lt;script type=&quot;text/javascript&quot; src=&quot;<a href="http://extjs.cachefly.net/ext-3.2.1/ext-all.js">http://extjs.cachefly.net/ext-3.2.1/ext-all.js</a>&quot;&gt;&lt;/script&gt;</div><div>        &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;<a href="http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css">http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css</a>&quot; /&gt;</div>

<div>        &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;<a href="http://extjs.cachefly.net/ext-3.2.1/examples/shared/examples.css">http://extjs.cachefly.net/ext-3.2.1/examples/shared/examples.css</a>&quot; /&gt;</div>

<div>        &lt;script src=&quot;<a href="http://www.openlayers.org/api/2.10/OpenLayers.js">http://www.openlayers.org/api/2.10/OpenLayers.js</a>&quot;&gt;&lt;/script&gt;</div><div>        &lt;script type=&quot;text/javascript&quot; src=&quot;<a href="http://api.geoext.org/1.0/script/GeoExt.js">http://api.geoext.org/1.0/script/GeoExt.js</a>&quot;&gt;&lt;/script&gt;</div>

<div><br></div><div>        &lt;script type=&quot;text/javascript&quot;&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>var mapPanel;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>var parentWin;</div>

<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>Ext.onReady(function() {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>var map = new OpenLayers.Map();</div><div>

<span class="Apple-tab-span" style="white-space:pre">                        </span>var layer = new OpenLayers.Layer.WMS(</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&quot;Global Imagery&quot;,</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&quot;<a href="http://maps.opengeo.org/geowebcache/service/wms">http://maps.opengeo.org/geowebcache/service/wms</a>&quot;,</div>

<div><span class="Apple-tab-span" style="white-space:pre">                                </span>{layers: &quot;bluemarble&quot;}</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>);</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>map.addLayer(layer);</div>

<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>mapPanel = {</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>xtype : &#39;gx_mappanel&#39;,</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>id : &#39;MAP_PANEL&#39;,</div>

<div><span class="Apple-tab-span" style="white-space:pre">                                </span>map : map,</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>zoom: 6</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>};</div>

<div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span> parentWin = new Ext.Window({</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>title: &quot;GeoExt MapPanel Window&quot;,</div>

<div><span class="Apple-tab-span" style="white-space:pre">                                </span>height: 400,</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>width: 600,</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>layout: &quot;fit&quot;,</div>

<div><span class="Apple-tab-span" style="white-space:pre">                                </span>items: [mapPanel]</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>}).show();</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div>

<div><span class="Apple-tab-span" style="white-space:pre">                </span>});</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>function mapGone() {</div>

<div><span class="Apple-tab-span" style="white-space:pre">                        </span>parentWin.removeAll();</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>parentWin.doLayout();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div>

<div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>function mapBack() {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>parentWin.add(mapPanel);</div>

<div><span class="Apple-tab-span" style="white-space:pre">                        </span>parentWin.doLayout();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;/script&gt;</div>

<div>    &lt;/head&gt;</div><div>    &lt;body&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;input type=&quot;button&quot; onclick=&quot;mapGone()&quot; value=&quot;map gone&quot;&gt;&lt;/input&gt;</div>

<div><span class="Apple-tab-span" style="white-space:pre">                </span>&lt;input type=&quot;button&quot; onclick=&quot;mapBack()&quot; value=&quot;map back&quot;&gt;&lt;/input&gt;</div><div>    &lt;/body&gt;</div><div>&lt;/html&gt;</div>

<div><br></div><div>I really wish somebody can give me some advice...</div><div>appreciate in advance!!</div>