[OpenLayers-Users] Re: Why Filter do not work ?

Phil Scadden p.scadden at gns.cri.nz
Tue Apr 17 17:42:37 EDT 2012


Are you sure this was copied correctly?
This bit
> <ogc:LPeter Lyamer
> Lyam</ogc:Literal>
is malformed. (Should be <ogc:Literal>Peter LyamerLyam</ogc:Literal>)

This is pretty weird. It is hard to understand how that could be 
happening. Try rewrite of code as:
var filter_value = document.getElementById("Text").value;

var c_filter = new OpenLayers.Filter.Logical({
type: OpenLayers.Filter.Logical.OR,
filters: [
new OpenLayers.Filter.Comparison({
     type: OpenLayers.Filter.Comparison.EQUAL_TO,
     matchCase:false,
     property: 'id',
     value:filter_value
     }),
new OpenLayers.Filter.Comparison({
     type: OpenLayers.Filter.Comparison.LIKE,
     matchCase:false,
     property: 'name',
     value: "*" + filter_value + "*"
     })
     ]
});

wfsProtocol.read({
     filter: c_filter,
     callback: processTheQuery,
     scope: strategy
          })

Unless this miraculously works, use firebug to debug into the writer in  
format\filter\v1.js
It beats me how this happens.
-- 
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, 
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.



More information about the Users mailing list