<div>I'm attempting to work out how to apply a filter to a WFS layer (from GeoServer 2.0.1), I've looked at the examples / documentation / forums and there seems to be a lot of discussion about doing this but I can't seem to find a definative solution.</div>
<div> </div>
<div>I've seen this thread <a href="http://n2.nabble.com/WFS-GetFeature-Filter-td4026139.html">http://n2.nabble.com/WFS-GetFeature-Filter-td4026139.html</a> which seems to indicate I need to download the latest build, so I'm using the nightly build from the OpenLayers site which reports a version number of 'Revision 10086'.</div>
<div> </div>
<div>This is my code:</div>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<div>wfsLayer = new OpenLayers.Layer.Vector( "WFS", { </div>
<div> strategies: [new OpenLayers.Strategy.BBOX()], </div>
<div> projection: new OpenLayers.Projection("EPSG:27700"), </div>
<div> maxExtent: new OpenLayers.Bounds(0, 0, 13000000, 13000000), </div>
<div> styleMap: mstylemap, </div>
<div> protocol: new OpenLayers.Protocol.WFS({ </div>
<div> url: "/MyApp/Proxy.ashx", </div>
<div> version: "1.1.0", </div>
<div> srsName: "EPSG:27700", </div>
<div> featurePrefix: "ora_store", </div>
<div> featureType: "BOUNDARY", </div>
<div> geometryName: "GEOM", </div>
<div> featureID: "OBJECTID", </div>
<div> defaultFilter: new OpenLayers.Filter.FeatureId(["BOUNDARY.1102283472"]) // should this be 1102283472 ?</div>
<div> })</div>
<div>});</div></blockquote>
<div dir="ltr">The FireFox error console reports: Error: uncaught exception: Filter writing not supported for rule type: undefined</div>
<div dir="ltr"> </div>
<div dir="ltr">If I comment out the filter then the WFS layer works fine.</div>
<div dir="ltr"> </div>
<div dir="ltr">So it appears that I've done something wrong in configuring my filter but I can't seem to work out what. </div>
<div dir="ltr"> </div>
<div dir="ltr">Do I need to set the filter elsewhere? </div>
<div dir="ltr"> </div>
<div dir="ltr">Also when using the FeatureId filter I assume I should use the ID as returned in GML (BOUNDARY.1102283472) and not as stored in the database (1102283472) - is that correct? I've tested both ways and get the same error.</div>
<div dir="ltr"> </div>
<div dir="ltr">Thanks in advance</div>
<div dir="ltr"> </div>
<div dir="ltr">Andrew</div>
<div dir="ltr"> </div>
<div dir="ltr"> </div>