Table Of Contents

Previous topic


Next topic



class GeoExt.form.FormPanel(config)

A specific Ext.form.FormPanel whose internal form is a GeoExt.form.BasicForm instead of Ext.form.BasicForm. One would use this form to do search requests through an OpenLayers.Protocol object (OpenLayers.Protocol.WFS for example).

Look at GeoExt.form.SearchAction to understand how form fields must be named for appropriate filters to be passed to the protocol.

Example Use

Sample code showing how to use a GeoExt form panel.

var formPanel = new GeoExt.form.FormPanel({
    renderTo: "formpanel",
    protocol: new OpenLayers.Protocol.WFS({
        url: "",
        featureType: "tasmania_roads",
        featureNS: ""
    items: [{
        xtype: "textfield",
        name: "name__ilike",
        value: "mont"
    }, {
        xtype: "textfield",
        name: "elevation__ge",
        value: "2000"
    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"

    text: "search",
    handler: function() {;
    scope: formPanel

Config Options

Configuration properties in addition to those listed for Ext.form.FormPanel.

OpenLayers.Protocol The protocol instance this form panel is configured with, actions resulting from this form will be performed through the protocol.

Public Methods

Public methods in addition to those listed for Ext.form.FormPanel.
Parameter:optionsObject The options passed to the GeoExt.form.SearchAction constructor.

Shortcut to the internal form’s search method.