<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><span>Hi I have modified my tree but I am having a problem understanding how to use the radiochange function.</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><span><br></span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">A test version is here <a href="http://maps.zgb.de/geoportal/treenodes.html">http://maps.zgb.de/geoportal/treenodes.html</a></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">Firstly I donīt understand why the plugin has a listener AND the tree has listener.</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div
style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">Secondly I canīt figure out why the first node creates havoc. If the first node is the first to be active, then the other nodes do not work. However any other node is first active, then all others work apart from the first node.!?!?!?</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">I am simply trying to active the getFeatureInfo control for the active node.</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">If anyone can explain my error, Iīd be most grateful,</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">Yours,</div><div style="font-family:
arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">Rob</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">//my code</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div><span><font size="2"><div> tree = new Ext.tree.TreePanel({</div><div> border: true,</div><div> region: "west",</div><div> title: "Layers",</div><div> width: 250,</div><div> split: true,</div><div> collapsible: true,</div><div> collapseMode: "mini",</div><div> autoScroll: true,</div><div> plugins:
[</div><div> new GeoExt.plugins.TreeNodeRadioButton({</div><div> listeners: {</div><div> "radiochange": function(node) {</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> activeNode = node;</div><div> <span class="Apple-tab-span" style="white-space:pre">                                </span> if(activeNode == node)</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span> {</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span> featureInfo.activate();</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>
selLayer = node.layer;</div><div> <span class="Apple-tab-span" style="white-space:pre">                </span> featureInfo.layers = [selLayer];</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> else</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span> {</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>
featureInfo.deactivate();</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> </div><div> }</div><div> }</div><div> })</div><div> ],</div><div> loader: new Ext.tree.TreeLoader({</div><div> uiProviders: {</div><div> "layernodeui": LayerNodeUI</div><div> }</div><div>
}),</div><div> root: {</div><div> nodeType: "async",</div><div> children: Ext.decode(treeConfig)</div><div> // Don't use the line above in your application. Instead, use</div><div> //children: treeConfig</div><div> </div><div> },</div><div> listeners: {</div><div> "radiochange": function(node){</div><div> // alert(node.layer.name + " is now the the active layer.");</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> activeNode =
node;</div><div> <span class="Apple-tab-span" style="white-space:pre">                                </span> if(activeNode == node)</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span> {</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span> featureInfo.activate();</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span> selLayer = node.layer;</div><div> <span class="Apple-tab-span" style="white-space:pre">                </span> featureInfo.layers = [selLayer];</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> else</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span> {</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span> featureInfo.deactivate();</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span> }</div><div> }</div><div> },</div><div> rootVisible: false,</div><div> lines: false,</div><div><br></div><div> });</div></font></span></div><div
style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div> <div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">Von:</span></b> Robert Buckley <robertdbuckley@yahoo.com><br> <b><span style="font-weight: bold;">An:</span></b> "users@geoext.org" <users@geoext.org> <br> <b><span style="font-weight: bold;">Gesendet:</span></b> 20:55 Dienstag, 6.März 2012<br> <b><span style="font-weight: bold;">Betreff:</span></b> [Users] problem with TreeNodeRadioButton and first layer in tree<br> </font> </div> <br><div id="yiv884203099"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 10pt; font-family: arial, helvetica, sans-serif; "><div style="font-size: 10pt; font-family: arial, helvetica,
sans-serif; ">Hi,</div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; ">I am trying to test the functionality of the radionode plugin. I have built a test app which lets the user switch the active layer and then use the getfeatureinfo tool to call the attributes.</div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; ">The behaviour is rather strange though. The top layer in the tree does not give me the featureinfo output UNLESS it is the first layer to be active. But if layer 1 is activated first all the other layers will not give featureinfos!!?!</div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; ">On the other hand, If I activate
any of the other layers...ie. layer 2,layer 3 or layer 4, in any order, they all give a getfeatureinfo response EXCEPT for Layer 1!!!!</div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; ">It is most probably something very simple to do with radio button activation or the getfeatureinfo tool, but i have looked for examples and canīt find anything that could help me.</div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; ">It is also rather irritating that the layer name is
taken from the openlayers "layer" config (ie. the name as it is stored in geoserver), and not from the "text" config which means that I canīt give the getFeatureinfo responses an understandable layer name.</div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; ">If anyone could help Iīd be most grateful,</div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; ">cheers</div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; ">Rob.</div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; "><br></div><div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; ">//CODE</div><div style="font-size: 10pt;
font-family: arial, helvetica, sans-serif; "><br></div><div><div><font face="arial, helvetica, sans-serif" size="2"> var LayerNodeUI = Ext.extend(GeoExt.tree.LayerNodeUI, new GeoExt.tree.TreeNodeUIEventMixin());</font></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font face="arial, helvetica, sans-serif" size="2"> var treeConfig = [{</font></div><div><font face="arial, helvetica, sans-serif" size="2"> nodeType: "gx_baselayercontainer",</font></div><div><font face="arial, helvetica, sans-serif" size="2"> hidden: true,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> }, {</font></div><div><font face="arial, helvetica, sans-serif" size="2"> nodeType: "gx_overlaylayercontainer",</font></div><div><font face="arial, helvetica, sans-serif" size="2">
expanded: true,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> loader: {</font></div><div><font face="arial, helvetica, sans-serif" size="2"> baseAttrs: {</font></div><div><font face="arial, helvetica, sans-serif" size="2"> radioGroup: "infoLayers",</font></div><div><font face="arial, helvetica, sans-serif" size="2"> uiProvider: "layernodeui"</font></div><div><font face="arial, helvetica, sans-serif" size="2"> }</font></div><div><font face="arial, helvetica, sans-serif" size="2"> }</font></div><div><font face="arial, helvetica, sans-serif" size="2"> }];</font></div><div><font face="arial, helvetica, sans-serif" size="2"> var featureInfo = new
OpenLayers.Control.WMSGetFeatureInfo({</font></div><div><font face="arial, helvetica, sans-serif" size="2"><span class="yiv884203099Apple-tab-span" style="white-space:pre;">        </span> infoFormat: "application/vnd.ogc.gml", </font></div><div><font face="arial, helvetica, sans-serif" size="2"> queryVisible: true,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> drilldown: true,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> highlightOnly: true,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> maxFeatures: 10,</font></div><div><font face="arial, helvetica, sans-serif" size="2"><span class="yiv884203099Apple-tab-span" style="white-space:pre;">                </span>eventListeners: {</font></div><div><font face="arial, helvetica, sans-serif" size="2">
"getfeatureinfo": function(e) { </font></div><div><font face="arial, helvetica, sans-serif" size="2"> var items = [];</font></div><div><font face="arial, helvetica, sans-serif" size="2"> Ext.each(e.features, function(feature) {</font></div><div><font face="arial, helvetica, sans-serif" size="2"> items.push({</font></div><div><font face="arial, helvetica, sans-serif" size="2"> xtype: "propertygrid",</font></div><div><font face="arial, helvetica, sans-serif" size="2">
title: feature.fid,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> source: feature.attributes</font></div><div><font face="arial, helvetica, sans-serif" size="2"> });</font></div><div><font face="arial, helvetica, sans-serif" size="2"> });</font></div><div><font face="arial, helvetica, sans-serif" size="2"><span class="yiv884203099Apple-tab-span" style="white-space:pre;">                </span>new GeoExt.Popup({</font></div><div><font face="arial, helvetica, sans-serif" size="2"> url:
"/geoserver/ows",</font></div><div><font face="arial, helvetica, sans-serif" size="2"> title: "getFeatureInfo",</font></div><div><font face="arial, helvetica, sans-serif" size="2"> layout: "border",</font></div><div><font face="arial, helvetica, sans-serif" size="2"> region:"east",</font></div><div><font face="arial, helvetica, sans-serif" size="2"> width: 250,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> height: 450,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> layout: "accordion",</font></div><div><font face="arial, helvetica, sans-serif" size="2">
bodyStyle:
'background-color:#FFF;,font-size:14px;',</font></div><div><font face="arial, helvetica, sans-serif" size="2"> autoScroll: true,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> map: mapPanel.map,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> location: e.xy,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> //location: e.xy,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> //lonlat: mapPanel.map.getLonLatFromPixel(e.xy),</font></div><div><font face="arial, helvetica, sans-serif" size="2"> // html: e.text,</font></div><div><font face="arial,
helvetica, sans-serif" size="2"> maximizable: false,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> resizable: false,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> collapsible: false,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> items: items </font></div><div><font face="arial, helvetica, sans-serif" size="2"> }).show(); </font></div><div><font face="arial, helvetica, sans-serif" size="2"> }</font></div><div><font face="arial, helvetica, sans-serif" size="2"> }</font></div><div><font face="arial, helvetica, sans-serif" size="2">
});</font></div><div><font face="arial, helvetica, sans-serif" size="2"> map.addControl(featureInfo);</font></div><div><font face="arial, helvetica, sans-serif" size="2"> // featureInfo.activate();</font></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font face="arial, helvetica, sans-serif" size="2"> treeConfig = new OpenLayers.Format.JSON().write(treeConfig, true);</font></div><div><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font face="arial, helvetica, sans-serif" size="2"> tree = new Ext.tree.TreePanel({</font></div><div><font face="arial, helvetica, sans-serif" size="2"> border: true,</font></div><div><font face="arial, helvetica,
sans-serif" size="2"> region: "west",</font></div><div><font face="arial, helvetica, sans-serif" size="2"> title: "Layers",</font></div><div><font face="arial, helvetica, sans-serif" size="2"> width: 250,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> split: true,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> collapsible: true,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> collapseMode: "mini",</font></div><div><font face="arial, helvetica, sans-serif" size="2"> autoScroll: true,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> plugins: [</font></div><div><font face="arial, helvetica, sans-serif" size="2"> new
GeoExt.plugins.TreeNodeRadioButton({</font></div><div><font face="arial, helvetica, sans-serif" size="2"> listeners: {</font></div><div><font face="arial, helvetica, sans-serif" size="2"> "radiochange": function(node) {</font></div><div><font face="arial, helvetica, sans-serif" size="2"> selLayer = node.layer;</font></div><div><font face="arial, helvetica, sans-serif" size="2"> featureInfo.activate();</font></div><div><font face="arial, helvetica, sans-serif" size="2"> featureInfo.layers = [selLayer];</font></div><div><font face="arial, helvetica, sans-serif" size="2">
}</font></div><div><font face="arial, helvetica, sans-serif" size="2"> }</font></div><div><font face="arial, helvetica, sans-serif" size="2"> })</font></div><div><font face="arial, helvetica, sans-serif" size="2"> ],</font></div><div><font face="arial, helvetica, sans-serif" size="2"> loader: new Ext.tree.TreeLoader({</font></div><div><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font face="arial, helvetica, sans-serif" size="2"> applyLoader: false,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> uiProviders: {</font></div><div><font face="arial, helvetica, sans-serif" size="2">
"layernodeui": LayerNodeUI</font></div><div><font face="arial, helvetica, sans-serif" size="2"> }</font></div><div><font face="arial, helvetica, sans-serif" size="2"> }),</font></div><div><font face="arial, helvetica, sans-serif" size="2"> root: {</font></div><div><font face="arial, helvetica, sans-serif" size="2"> nodeType: "async",</font></div><div><font face="arial, helvetica, sans-serif" size="2"> children: Ext.decode(treeConfig)</font></div><div><font face="arial, helvetica, sans-serif" size="2"> },</font></div><div><font face="arial, helvetica, sans-serif" size="2"> rootVisible: false,</font></div><div><font face="arial, helvetica, sans-serif" size="2"> lines:
false,</font></div><div><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font face="arial, helvetica, sans-serif" size="2"> });</font></div></div></div></div></div><br>_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@geoext.org" href="mailto:Users@geoext.org">Users@geoext.org</a><br><a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br><br><br> </div> </div> </div></body></html>