<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple>
<BR>
<BR>
<div class=WordSection1><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>Please can I have some advice as to why the following code isn’t working. When you enter a search parameter using the formpanel and click search no results are displayed in the gridpanel, but a new blank layer called results is created. I think it maybe something to do with connecting to Geoserver.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>var protocol = new OpenLayers.Protocol.WFS({<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> url: "http://192.168.10.44:8085/geoserver/wfs",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> version: "1.1.0", <o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> featureType: "aha_trees",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> featureNS: "http://www.grandunionhousing.co.uk/guhg_data",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> srsName: epsg27700,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> geometryName: "geometry"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>});<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>var features = new Array();<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>");<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>var selects = new GeoExt.grid.FeatureSelectionModel();<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>var cols = [<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> {name: 'tree_ref', type: 'string'},<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> {name: 'x', type: 'string'},<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> {name: 'y', type: 'integer'}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>];<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>var reader = new GeoExt.data.FeatureReader({}, cols);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>var store = new GeoExt.data.FeatureStore({<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> id: "gridStore",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> reader: reader,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> fields: cols,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> autoLoad: false<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>});<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>var formPanel = new GeoExt.form.FormPanel ({<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> title: "Postcode Search",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> height: 100,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> width: 350,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> bodyStyle: "padding: 5px;",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> region: "north",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> protocol: protocol,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> items: [{<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> xtype: "textfield",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> name: "tree_ref__like",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> allowBlank: false,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> fieldLabel: "Tree Reference",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> minLength: 1<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> }],<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> listeners: {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> actioncomplete: function(form, action) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> features = action.response.features;<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> store.loadData(features);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> vm=app.mapPanel.map.getLayersByName("Results");<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> if (vm.length===0) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> vecLayer = new OpenLayers.Layer.Vector("Results");<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> app.mapPanel.map.addLayer(vecLayer);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> store.bind(vecLayer);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> selects.bind(vecLayer);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> },<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> buttons: [{<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> text: "Search",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> handler: function() {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> var mygrid = Ext.getCmp('gridPanel');<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> mygrid.expand();<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> formPanel.search();<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> },<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> scope: formPanel<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> }],<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> keys: [{<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> key: [Ext.EventObject.ENTER],<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> handler: function() {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> var mygrid = Ext.getCmp('gridPanel');<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> mygrid.expand();<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> formPanel.search();<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> }]<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>});<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>var gridPanel = new Ext.grid.GridPanel({<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> id: "gridPanel",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> title: "Results",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> region: "center",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> collapsible: true,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> collapsed: false,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> store: store,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> height: 500,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> stripeRows: true,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> autoExpandColumn: 'tree_ref',<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> columns: [{<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> id: "tree_ref",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> header: "Tree Reference",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> width: 50,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> sortable: true,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> dataIndex: "tree_ref"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> }, {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> id: "x",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> header: "Lat",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> width: 50,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> dataIndex: "x"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> }, {<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> id: "y",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> header: "Lon",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> width: 50,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> dataIndex: "y"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> }],<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> sm: selects<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>});<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>searchPanel = new Ext.Panel({<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> layout: "border",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> region: "east",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> collapsible: true,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> width: 250,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> items: [formPanel, gridPanel]<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>})<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>Any help would be most appreciated.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>Graeme<o:p></o:p></span></p></div>
<BR>
<BR>
<p class=MsoNormal><span style='font-size:7.5pt;font-family:"Verdana","sans-serif";
color:gray'>---------------------------------------------------------------------------------------------------------------------<br>
This email and any files transmitted with it are confidential and intended
solely for the use <br>
of the individual or entity to whom they are addressed. If you have
received this email in <br>
error please let us know by email reply and delete it from your system. <br>
<br>
Please note that any views or opinions presented in this email are solely
those of the <br>
author and do not necessarily represent those of Grand Union Housing Group.
<br>
<br>
Finally, the recipient should check this email and any attachments for the
presence of viruses. <br>
Grand Union Housing Group accepts no liability for any damage caused by any
virus <br>
transmitted by this email. <br>
<br>
<strong><u><span style='font-family:"Verdana","sans-serif"'>Grand Union
Housing Group</span></u></strong>
<BR>Martell House
<BR>University Way
<BR>Cranfield
<BR>Bedfordshire
<BR>MK43 0TR
<BR>Telephone: 01525 844590<BR>
<BR>Registered under the Industrial and Provident Societies Act 1965 Registered
No. 30388R <br>
Housing Corporation Registered No. L4518 <br>
<br>
<a href="http://www.grandunionhousing.co.uk/">http://www.grandunionhousing.co.uk</a><br>
--------------------------------------------------------------------------------------------------------------------</span><o:p></o:p></p>
</td>
<td style='padding:0cm 0cm 0cm 0cm'>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'> </span><o:p></o:p></p>
</td></body></html>