[Users] formPanel search not working with WFS

Matt Priour mpriour at kestrelcomputer.com
Wed Sep 7 01:01:59 CEST 2011


MessageOne problem is that you don’t use any of the special search action naming conventions:
http://dev.geoext.org/docs/lib/GeoExt/widgets/form/SearchAction.html 
Since you aren’t using the search action naming conventions, I don’t think it is creating a GeoExt.form.SearchAction and thus not firing the ‘actioncomplete’ event.
It is however directly using your search fields to fill a WFS filter and thus generating proper GML on client & server sides.
Try using the search action naming convention and see if it fires your event listener.
Matt Priour

From: John M. Stein 
Sent: Tuesday, September 06, 2011 3:58 PM
To: users at geoext.org 
Subject: [Users] formPanel search not working with WFS

Hello All,

I'm trying to set up a very simple search form.  Most of my usergroup perusals have shown that it seems to be pretty straightforward, but for some reason this just won't work.  When the search is sent, I recieve (via Firebug) a GML that, once saved into its own .xml on the server, works perfectly fine.  For whatever reason, it just doesn't want to show up from the POST request.

Here's the code:


    formPanel = new GeoExt.form.FormPanel({
        title: "SEARCHBOX",   
        region: "north",     
        width: 300,
        height: 100,
        protocol: new OpenLayers.Protocol.WFS({
              url:  GeoserverWFS,
              version: "1.1.0",
              featureType: "plant_view",
              featureNS: "localparks",
              srsName: "EPSG:3734"                    
              }),
        items: [{
            xtype: "textfield",
            name: "p_genus",
            value: "Acer",
            fieldLabel: "GENUS"
        }, {
            xtype: "textfield",
            name: "p_species",
            value: "saccharinum",
            fieldLabel: "SPECIES"
        }
],

    listeners: {
        actioncomplete: function(form, action) {
//   alert(action.response);   
            }

    }
});

    formPanel.addButton({
        text: "search",
        handler: function() {
            this.search();
        },
        scope: formPanel
    });

 
right?  pretty standard.  I tried WFS 1.0.0. and 1.1.0.  I tried playing around with WFS settings in GeoServer (changing SRS styles from XML to URN - which never changes the request..).

The important thing is that I'm getting a proper GML Post from the search.  I tried adding a blank vector layer to the eventlistener and adding bindings from a FeatureDataStore, but those methods failed me as well.  Is there some basic setting in WFS that I am completely missing?  Might this have to do with geoserver version (2.1.0)?  

Is there anything else I can do with the eventlistener to force a rendering of the response?  Something with action.response written into a temp.xml and rendered?  

Thanks for any insight..

John Stein
Geographic Information Systems (GIS) Intern
(216) 635 3239   [Mon, Tues, Thurs] 
Horticulture Intern

(330) 760 3243   [Wed, Fri]

jms at clevelandmetroparks.com


 

 

 

 



John Stein
Geographic Information Systems (GIS) Intern
(216) 635 3239   [Mon, Tues, Thurs] 
Horticulture Intern

(330) 760 3243   [Wed, Fri]

jms at clevelandmetroparks.com


 

 

 

 




--------------------------------------------------------------------------------
_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110906/c5bbec41/attachment-0001.htm 


More information about the Users mailing list