use the proper search decorations on the field name:
ex. 'bez__like'
see:
http://api.geoext.org/1.0/docs/lib/GeoExt/widgets/form/SearchAction.html#GeoExt.form.SearchAction
if you use a GeoExt.form.FormPanel and don't use a filter convention on the
name it is assumed that you want an EQUAL_TO condition.
You also can set the wildcard flag and logical operation in the options
parameter when calling the search function:
ex.
formPanel.search({wildcard:GeoExt.form.STARTS_WITH,logicalOp:OpenLayers.Filter.Logical.OR});
the default logical operation is AND
if you use a LIKE comparison but don't set a wildcard flag, then it acts just
like an EQUAL_TO comparison
Matt Priour
Kestrel Computer Consulting
From: Robert Buckley
Sent: Tuesday, March 22, 2011 5:49 AM
To: [email protected]
Subject: Re: [Users] Search tool in Geoext App
I have used the following code and get a good result, but the exact string has
to be entered. I know I need to somehow user a filter with LIKE but don´t know
where I should code this..Definate lack of examples.
could anone tell me how I would basically use the LIKE filter and put the
results into a grid?
yours,
Rob
// search
var formPanel = new GeoExt.form.FormPanel({
// renderTo: "formpanel",
protocol: new OpenLayers.Protocol.WFS({
url: "http://MyDomain:8080/geoserver/wfs",
featureType: "wea_wgs84",
featureNS: "http://MyDomain/postgis"
}),
region: "west",
width: 400,
border: false,
items: [{
xtype: "textfield",
name: "bez",
value: "WF"
}, {
xtype: "textfield",
name: "standort",
value: "Asse"
}],
listeners: {
actioncomplete: function(form, action) {
// this listener triggers when the search request
// is complete, the OpenLayers.Protocol.Response
// resulting from the request is available
// in "action.response"
}
}
});
formPanel.addButton({
text: "search",
handler: function() {
this.search();
},
scope: formPanel
});
--------------------------------------------------------------------------------
Von: Robert Buckley <[email protected]>
An: [email protected]
Gesendet: Dienstag, den 22. März 2011, 8:10:23 Uhr
Betreff: [Users] Search tool in Geoext App
Hi,
I am building a series of basic webviewers which will basically just load wms
intoa viewport and offer the user navigation tools, a quick zoom combobox,
legend panel and contents panel.
I have come this far and it is now been asked if I can build a simple search
mechanism.
I would like to offer the user a combobox to first pick the layer, then the
field, then then either enter a word or get a list of entries coming from that
field.
I believe I have seen something similar in other apps and that it is possible
to build something like this, but I don´t know where to find any code examples.
Is it true that this search would have to be based on wfs and that a search on
wms isn´t possible?
Could anyone offer me any help regarding this search mechanism?
thanks for any tips,
Robert
--------------------------------------------------------------------------------
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users