Hello GeoExt Friends,<br><br>So I have been using the GeoExt and Ext libraries to develop my map browser and now there&#39;s a feature I&#39;d like to have, but don&#39;t know how to go about it :)<br><br>So far everything is working.  What I have is a tree panel that when a menu is clicked a parent node with layer containers is added to the tree.  The layers in these containers are in different languages, so as the user toggles between the languages in the menu, it be nice if the layers in the previous language correspond to the language that is currently selected.  I hope you will understand what I am asking to do.  I guess a good starting point would be, is there a way to &quot;get&quot; which layers are selected in a layer container?  Thanks for your time, below is some relevant code:<br>
<br>//So there are many layers, one each per language...<br><br>var chn_townships = new OpenLayers.Layer.WMS(<br>                            &quot;Townships (Chinese trans)&quot;, &quot;<a href="http://localhost:8080/geoserver/wms">http://localhost:8080/geoserver/wms</a>&quot;, {layers: &#39;cite:chn_townships&#39;, transparent: true}, {isBaseLayer: false, displayInLayerSwitcher: true, visibility: false}<br>
                       );<br>                    <br>            var tib_townships = new OpenLayers.Layer.WMS(<br>                            &quot;Townships (Tibetan trans)&quot;, &quot;<a href="http://localhost:8080/geoserver/wms">http://localhost:8080/geoserver/wms</a>&quot;, {layers: &#39;cite:tib_townships&#39;, transparent: true}, {isBaseLayer: false, displayInLayerSwitcher: true, visibility: true} <br>
                       );  <br><br>//The layers are stored in layer stores...<br>var tibLands = new GeoExt.data.LayerStore({<br>                map: map,<br>                initDir: 0,<br>                layers: [tib_villages, tib_townships, tib_farms, tib_countys]<br>
            });<br><br>            var chnLands = new GeoExt.data.LayerStore({<br>                map: map,<br>                initDir: 0,<br>                layers: [chn_villages, chn_townships, chn_farms, chn_countys]<br>
            });<br><br>//Menu for users to select language<br>var languageMenu = new Ext.menu.Menu({<br>                id: &#39;mainMenu&#39;,<br>                style: {<br>                    overflow: &#39;visible&#39;     // For the Combo popup<br>
                },<br>                items: [<br>                    // A Field in a Menu<br>                    {<br>                        text: &#39;Chinese&#39;,<br>                        checked: false,<br>                        group: &#39;theme&#39;,<br>
                        icon: &#39;./gif/cn.gif&#39;,<br>                           handler: checkHandler<br>                    },{<br>                        text: &#39;English&#39;,<br>                        checked: true,<br>
                        group: &#39;theme&#39;,<br>                        handler: checkHandler<br>                    },{<br>                        text: &#39;Tibetan&#39;,<br>                        checked: false,<br>
                        group: &#39;theme&#39;,<br>                        handler: checkHandler<br>                        }<br>                ]<br>            });<br><br>//The handler function that listens to the users selection on the menu (This is where I want the magic to happen ;)<br>
function checkHandler(item, checked) {<br>                    var tibetContainer, chineseContainer;<br>                    <br>                    if(item.text == &#39;Tibetan&#39;){<br>                        if(<a href="http://layerRoot.lastChild.id">layerRoot.lastChild.id</a> == &#39;chinese&#39;){<br>
                            layerRoot.removeChild(layerRoot.lastChild);    <br>                        }<br>                        <br>                        tibetContainer = new Ext.tree.TreeNode({<br>                            text: &quot;Tibetan Labels&quot;,<br>
                            expanded: true,<br>                            id: &#39;tibet&#39;<br>                        });<br><br>                        tibetContainer.appendChild(new GeoExt.tree.OverlayLayerContainer({<br>
                            text: &quot;Lands (Tibetan trans)&quot;,<br>                            layerStore: tibLands,<br>                            expanded: false,<br>                            loader: {param: &quot;LAYERS&quot;}<br>
                        }));<br><br>                        tibetContainer.appendChild(new GeoExt.tree.OverlayLayerContainer({<br>                            text: &quot;Natural Selection (Tibetan trans)&quot;,<br>                            layerStore: tibNaturalLayers,<br>
                            expanded: false,<br>                            loader: {param: &quot;LAYERS&quot;}<br>                        }));<br><br>                        tibetContainer.appendChild(new GeoExt.tree.OverlayLayerContainer({<br>
                            text: &quot;Points of Interest (Tibetan trans)&quot;,<br>                            layerStore: tibPointOfInterest,<br>                            expanded: false,<br>                            loader: {param: &quot;LAYERS&quot;}<br>
                        }));<br><br>                        layerRoot.appendChild(tibetContainer);<br><br>                    }<br>                    else if(item.text == &#39;Chinese&#39;){<br>                        <br>
                        chineseContainer = new Ext.tree.TreeNode({<br>                            text: &quot;Chinese Labels&quot;,<br>                            expanded: true,<br>                            id: &#39;chinese&#39;<br>
                        });<br><br>                        chineseContainer.appendChild(new GeoExt.tree.OverlayLayerContainer({<br>                            text: &quot;Lands (Chinese trans)&quot;,<br>                            layerStore: chnLands,<br>
                            expanded: false,<br>                            loader: {param: &quot;LAYERS&quot;}<br>                        }));<br><br>                        chineseContainer.appendChild(new GeoExt.tree.OverlayLayerContainer({<br>
                            text: &quot;Natural Selection (Chinese trans)&quot;,<br>                            layerStore: chnNaturalLayers,<br>                            expanded: false,<br>                            loader: {param: &quot;LAYERS&quot;}<br>
                        }));<br><br>                        chineseContainer.appendChild(new GeoExt.tree.OverlayLayerContainer({<br>                            text: &quot;Points of Interest (Chinese trans)&quot;,<br>                            layerStore: chnPointOfInterest,<br>
                            expanded: false,<br>                            loader: {param: &quot;LAYERS&quot;}<br>                        }));<br><br>                        if(<a href="http://layerRoot.lastChild.id">layerRoot.lastChild.id</a> == &#39;tibet&#39;){<br>
                            //layerRoot.removeChild(layerRoot.lastChild);    <br>                            layerRoot.replaceChild(chineseContainer, layerRoot.lastChild)  //thought this might have done it, this just replaces the nodes but not the layers selected to the new ones :(<br>
                        }else<br>                        {layerRoot.appendChild(chineseContainer);}<br><br>                    }<br>