This ticket is about adding (1) a specific Ext.form.Action, namely GeoExt.form.SearchAction, and (2) the GeoExt.form.BasicForm and GeoExt.form.FormPanel helper classes to ease creating forms using a SearchAction.
A GeoExt.form.SearchAction instance does search requests using an internal OpenLayers.Protocol. A GeoExt.form.SearchAction creates an OpenLayers.Filter.Logical from the form and passes that filter to its protocol's read method. A naming convention is used to derive the OpenLayers.Filter.Comparison type from the form field.
GeoExt.form.SearchAction can be used with Ext.form.FormPanel directly. Example:
var formPanel = new Ext.form.FormPanel({
items: [{
xtype: "textfield",
name: "foo__like"
}, {
xtype: "textfield",
name: "bar__ge"
}]
});
var searchAction = new GeoExt.form.SearchAction(formPanel.getForm(), {
protocol: new OpenLayers.Protocol.WFS()
});
formPanel.getForm().doAction(searchAction);
The GeoExt.form.BasicForm and GeoExt.form.FormPanel classes this ticket suggests adding aim to make the use of GeoExt.form.SearchAction as seamless as possible:
var formPanel = new GeoExt.form.FormPanel({
protocol: new OpenLayers.Protocol.WFS(),
items: [{
xtype: "textfield",
name: "foo__like"
}, {
xtype: "textfield",
name: "bar__ge"
}]
});
formPanel.getForm().doAction("search");
We could imagine adding a GeoExt.form.SaveAction later. This action would also be configured with a protocol but would do protocol.commit() instead of protocol.save(). It will be triggered with formPanel.getForm().doAction("save").
Patch to come.