Hi Robert,<div><br></div><div>What you can do in fact is:</div><div><br></div><div>- Make a geoserver template that will return your data in JSON format</div><div>- Then, process the data as you wish on the client side (this is, using GeoExt)</div>
<div><br></div><div>Below you can find an example of content.ftl that is returning the data in JSON format.</div><div><br></div><div><div>[{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span><#assign i = 0 /></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span><#list type.attributes as attribute></div><div><span class="Apple-tab-span" style="white-space:pre">                </span><#if (i >= 0) && (!attribute.isGeometry)></div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>"${<a href="http://attribute.name">attribute.name</a>}":</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span><#list features as feature></div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span><#assign k = 0 /></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span><#list feature.attributes as attribute></div><div>
<span class="Apple-tab-span" style="white-space:pre">                                        </span><#if (k = i) && (!attribute.isGeometry)></div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>"${attribute.value}"</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span></#if></div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span><#assign k = k+1 /></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span></#list></div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span><#if attribute_has_next></div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>,</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span></#if></div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span></#list></div><div><span class="Apple-tab-span" style="white-space:pre">                </span></#if></div><div><span class="Apple-tab-span" style="white-space:pre">                </span><#assign i = i+1 /></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></#list></div><div>}]</div><div><br></div><div>hope this helps.</div><div>Cheers,</div><div><br></div><div>Hugo</div><br><div class="gmail_quote">On Thu, Jul 21, 2011 at 12:15 PM, Robert Buckley <span dir="ltr"><<a href="mailto:robertdbuckley@yahoo.com">robertdbuckley@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family:arial, helvetica, sans-serif">
<code>Hi,</code></div><div style="font-family:arial, helvetica, sans-serif"><code><br></code></div><div style="font-family:arial, helvetica, sans-serif"><code>Standard format... </code><span style="font-family:monospace">text/html as defined in the Parameter tab in Firebug.</span></div>
<div style="font-family:arial, helvetica, sans-serif"><span style="font-family:monospace"><br></span></div><div style="font-family:arial, helvetica, sans-serif"><span style="font-family:monospace">I have read that if the format is
changed, then the attributes can be manipulated ie fields can be left out. I havenīt seen any code fór it though.</span></div><div style="font-family:arial, helvetica, sans-serif"><span style="font-family:monospace"><br>
</span></div><div style="font-family:arial, helvetica, sans-serif"><span style="font-family:monospace">I have tried with the content.ftl file in the geoserver workspaces, but the results are pretty grim! I would rather do it in javascript so that everything is kept in my app and not spread around different applications.</span></div>
<div style="font-family:arial, helvetica, sans-serif"><span style="font-family:monospace"><br></span></div><div style="font-family:arial, helvetica, sans-serif"><span style="font-family:monospace">yours,</span></div><div style="font-family:arial, helvetica, sans-serif">
<span style="font-family:monospace"><br></span></div><div style="font-family:arial, helvetica, sans-serif"><span style="font-family:monospace">Rob</span></div><div style="font-family:arial, helvetica, sans-serif"><span style="font-family:monospace"><br>
</span></div><div class="hm"><div style="font-family:arial, helvetica, sans-serif"><span style="font-family:monospace"><br></span></div></div><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div class="hm">
<br></div><div style="font-family:arial, helvetica, sans-serif;font-size:13px"><div class="hm"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight:bold">Von:</span></b> "<a href="mailto:dan@inlet.geol.sc.edu" target="_blank">dan@inlet.geol.sc.edu</a>" <<a href="mailto:dan@inlet.geol.sc.edu" target="_blank">dan@inlet.geol.sc.edu</a>><br>
<b><span style="font-weight:bold">An:</span></b> Robert Buckley <<a href="mailto:robertdbuckley@yahoo.com" target="_blank">robertdbuckley@yahoo.com</a>><br><b><span style="font-weight:bold">CC:</span></b> <a href="mailto:users@geoext.org" target="_blank">users@geoext.org</a><br>
<b><span style="font-weight:bold">Gesendet:</span></b> Donnerstag, den 21. Juli 2011, 12:24:24 Uhr<br><b><span style="font-weight:bold">Betreff:</span></b> Re: [Users] control which fields are displayed in my Geoext popups<br>
</font></div><div><div></div><div class="h5"><br>What is the format of the data coming back from the WMSGetFeatureInfo?<br><br>> Hi,<br>><br>> I would like to do the following and after several hours of trying and<br>
> googling<br>> will have to admit that I havenīt got far.<br>><br>> I want to ...<br>><br>> 1. Restrict the fields displayed in my popup window so that I can control<br>> which<br>> fields are displayed. I donīt want to show fid, objectid etc<br>
><br>> 2. Ideally I would like to use the accordion layout for when there is more<br>> than<br>> one queryable layer, but I canīt find any code to implement this. I have<br>> seen it<br>> on Bryan Mcbrides explorer, but apart from that canīt find any<br>
>
documentation.<br>><br>> currently I have a popup designed like this...<br>><br>><br>> // create the popup<br>> var featureInfo = new OpenLayers.Control.WMSGetFeatureInfo({<br>> queryVisible: true,<br>
> highlightOnly: true,<br>> maxFeatures: 5,<br>> layers: [layer_wea_wms,EnMap_SG_WEA_f]<br>> });<br>><br>> featureInfo.events.on({<br>> getfeatureinfo: function(e) {<br>> new GeoExt.Popup({<br>
> title: "Position:<br>> "+mappanel.map.getLonLatFromPixel(e.xy).transform(epsg900913, epsg4326),<br>> width: 400,<br>> autoHeight: true,<br>> layout: 'accordion',<br>
> bodyStyle: 'background-color:#FFF;,font-size:14px;',<br>> autoScroll: true,<br>> maximizable: true,<br>>
map: mappanel.map,<br>> lonlat: mappanel.map.getLonLatFromPixel(e.xy),<br>> html:'<p style="font-size:10px;">Attributen</p><br>'+e.text,<br>> unpinnable:true,<br>
> anchored: true,<br>> shadow: true,<br>> listeners: {<br>> close: function() {<br>> // closing a popup destroys it, but our reference<br>> is<br>> truthy<br>
> popup = null;<br>> }<br>> }<br>> }).show();<br>> }<br>> });<br>><br>> map.addControl(featureInfo);<br>>
featureInfo.activate();<br>><br>><br>><br>><br>> thanks for any help_______________________________________________<br>> Users mailing list<br>> <a href="mailto:Users@geoext.org" target="_blank">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><br></div></div></div></div><div style="font-family:arial, helvetica, sans-serif">
</div>
</div></div><br>_______________________________________________<br>
Users mailing list<br>
<a 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></blockquote></div><br><br clear="all"><br>-- <br>Hugo Martins<br>LabNT - ISEGI UNL<br>Campus de Campolide<br>1070-312 Lisboa<br>N 38°43'56.84", W 9°9'35.74"<br>
</div>