I am trying to place a combo-box in the top of my web application which will search an internal WFS from Geoserver. I am using the combo-box so I can have the "type ahead" functionality which I think will help then narrow down the site they are looking for. Then once I solve this issue I will have a listener which will get the info and zoom to the location on selection.

I am working of a test at then moment to see if I can implement it in an existing site, but I am running into some trouble. The combo-box doesn't filter the data store, it just returns a full list of the datastore regardless of what i type (see picture at bottom of post).

The code I have used is below, unfortunately I don't have an external facing site to show.

I originally was hoping to set my WFS output format to JSON and just load that into a JSON data store but I kept getting errors that I was unable to decipher.



var queryLayer = "dam";
var protocol= OpenLayers.Protocol.WFS({
    url: "/geoserver/ows",
    featureType: queryLayer,
    featureNS: "www.awebsite.com.au", //Just for SE proper featureNS website used in application
    version: "1.0.0",
    srsName: "EPSG:4283"

var assetStore = new GeoExt.data.FeatureStore({
    fields: [
        {name: "name", type: "string"}
        //{name: "type", type: "string"}
    proxy: new GeoExt.data.ProtocolProxy({
            protocol: protocol              

new Ext.Viewport({
    layout: "border",
    items: [{
        region: "center",
        id: "mappanel",
        //title: "Map",
        xtype: "gx_mappanel",
        map: map,
                xtype: 'combo',
                fieldLabel: 'Search for an asset:',
                store: assetStore,
                displayField: 'name',
                forceSelection: true,
                triggerAction: 'all',
                minChars: 1,
                displayField: 'name'                                                            
        layers: [layer],
        extent: extent,
        split: true

enter image description here

Edit This is the query that is getting sent to the server, its not passing the name from the combo box to the query so I assume that why everything is being returned. Is there a configOption I am missing here??

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:Query typeName="feature:dam" xmlns:feature="www.mywebsite.com.au"/></wfs:GetFeature>

closed as off-topic by blah238, Fezter, whuber Jul 24 '13 at 2:20

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about software development are off-topic here unless they relate directly to Geographical Information Systems, but they can be asked on Stack Overflow." – blah238, Fezter, whuber
If this question can be reworded to fit the rules in the help center, please edit the question.


Had the same problem today! Remove the

 triggerAction: 'all',

option and it will work. triggerAction in fact tells the combox to always display all of its values regardless of filters.

Documentation is scarce, but this thread describes the possible values for triggerAction:


  • I tried your suggestion with no luck unfortunately. I attached to my original post the request getting sent to the server, and it appears that the name in the combo box is not being included in the <wfs:query> request. Not to sure why, been googling with no avail - I may ditch the combo box and just have a text field search. – Ando Dec 16 '11 at 22:45

In your combobox you only appeaar to be setting a displayField and not a valueField - the actual value that is selected when an item is selected. Try:

            xtype: 'combo',
            fieldLabel: 'Search for an asset:',
            store: assetStore,
            displayField: 'name',
            forceSelection: true,
            triggerAction: 'all',
            minChars: 1,
            displayField: 'name',
            valueField: 'name'                                                      

Add this to the combo box config:




You should try that config option:

typeAhead: true

See: documentation

  • I put that configuration option in, same results. – Ando Dec 8 '11 at 19:47

I had the same problem caused by running clearFilter on the store e.g: assetStore.clearFilter();

Remove this from your code, it's not needed in ext4.

Not the answer you're looking for? Browse other questions tagged or ask your own question.