A specific Ext.form.Action to be used when using a form to do trigger search requests througn an OpenLayers.Protocol.
Arguments:
form Ext.form.BasicForm A basic form instance.
One can add an abortPrevious property to these options, if set to true, the abort method will be called on the protocol if there’s a pending request.
When run this action builds an OpenLayers.Filter from the form and passes this filter to its protocol’s read method. The form fields must be named after a specific convention, so that an appropriate OpenLayers.Filter.Comparison filter is created for each field.
For example a field with the name foo__like would result in an OpenLayers.Filter.Comparison of type OpenLayers.Filter.Comparison.LIKE being created.
Here is the convention:
In most cases your would not directly create GeoExt.form.SearchAction objects, but use GeoExt.form.FormPanel instead.
Sample code showing how to use a GeoExt SearchAction with an Ext form panel:
var formPanel = new Ext.form.Panel({
renderTo: "formpanel",
items: [{
xtype: "textfield",
name: "name__like",
value: "mont"
}, {
xtype: "textfield",
name: "elevation__ge",
value: "2000"
}]
});
var searchAction = new GeoExt.form.SearchAction(formPanel.getForm(), {
protocol: new OpenLayers.Protocol.WFS({
url: "http://publicus.opengeo.org/geoserver/wfs",
featureType: "tasmania_roads",
featureNS: "http://www.openplans.org/topp"
}),
abortPrevious: true
});
formPanel.getForm().doAction(searchAction, {
callback: function(response) {
// response.features includes the features read
// from the server through the protocol
}
});
Public properties in addition to those listed for Ext.form.Action.