Ticket #49 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

specific form Action, BasicForm and FormPanel

Reported by: elemoine Assigned to:
Priority: major Milestone: 0.5
Component: widgets Version:
Keywords: Cc:
State: Commit

Description

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.

Attachments

patch-49-r476-A0.diff (24.8 kB) - added by elemoine on 04/27/09 16:38:49.
patch-49-r486-A1.diff (25.7 kB) - added by elemoine on 04/28/09 08:25:52.
add convenience method "search" to BasicForm and FormPanel
patch-49-r486-A2.diff (28.2 kB) - added by elemoine on 04/28/09 09:17:01.
test that actioncomplete and actionfailed trigger
patch-49-r607-A3.diff (31.7 kB) - added by elemoine on 05/06/09 09:18:41.
with jst docs
patch-docsrc-49-r607-A0.diff (0.7 kB) - added by elemoine on 05/06/09 09:29:36.
docsrc changes

Change History

04/27/09 16:38:49 changed by elemoine

  • attachment patch-49-r476-A0.diff added.

04/27/09 16:40:30 changed by elemoine

patch-49-r476-A0.diff provides a patch, with tests and an example.

All tests pass on FF3.

04/27/09 16:44:56 changed by elemoine

  • state changed from None to Review.

04/28/09 08:25:52 changed by elemoine

  • attachment patch-49-r486-A1.diff added.

add convenience method "search" to BasicForm and FormPanel

04/28/09 09:17:01 changed by elemoine

  • attachment patch-49-r486-A2.diff added.

test that actioncomplete and actionfailed trigger

05/06/09 09:18:41 changed by elemoine

  • attachment patch-49-r607-A3.diff added.

with jst docs

05/06/09 09:29:36 changed by elemoine

  • attachment patch-docsrc-49-r607-A0.diff added.

docsrc changes

05/06/09 09:29:56 changed by elemoine

  • milestone set to 0.1.

05/07/09 11:27:40 changed by pgiraud

Everything looks good to me. I think it's ready to commit. This would sound even better if non-camptocamp guys can also have a quick look.

05/12/09 21:17:23 changed by elemoine

pgiraud, can I consider "everything looks good" as "go ahead and commit"? :-) Please set the ticket state to "Commit" if that's the case. In the mean time if someone wants to take a look at the patch, I'd be happy to take comments.

05/13/09 08:38:33 changed by pgiraud

  • state changed from Review to Commit.

05/13/09 09:39:05 changed by elemoine

  • status changed from new to closed.
  • resolution set to fixed.

(In [707]) specific form Action, BasicForm and FormPanel, r=pgiraud (closes #49)