The 1st thing you need when developing against any OWS (WMS,WFS,WMC,CWS,etc..) is a way to actually see the message to & response from the server. You can use Fiddler (PC Only) or Firebug (Firefox) or (to a much more limited degree) WebKit Developer Tools.
Without tools like this, you are really just shooting in the dark. Assuming that all the code below is correct and you are using Geoserver, then you MUST get the featureNS value. It is pretty easy, just logon to Geoserver and look at the layer list. We'll take the tiger:poi layer as an example. On the Layers list you see Type, Workspace, Store, & Layer Name columns. The ones you are interested in are Workspace and Layer Name columns. For the tiger:poi example you can either use: featureType:'tiger:poi', (that is the layer name with the namespace) featureNS:'http://www.census.gov' (that is the Workspace URI) -- OR -- featureType:'poi' (that is the layer name, without the namespace) featureNS:'tiger' (that is the namespace, which is the same as the Workspace) the first example is really the 'correct' way, but the second way works as well. Hope that helps NOTE: If you are using other servers, like Mapserver, then using namespaces can sometimes cause issues. Matt Priour From: truongxuan quang Sent: Friday, November 26, 2010 5:28 PM To: [email protected] Subject: [Users] Question about FormPanel Hello List, I am trying to do search function following example in this site http://ian01.geog.psu.edu/geoserver/www/search/gazetteer.html I wrote almost same the above example given, I change only in my data what I istalled in Geoserver var protocol= OpenLayers.Protocol.WFS({ url: "http://localhost:8080/geoserver/wfs", featureType: "municipaliteis", //featureNS: "http://geovista.psu.edu" I dont know how to fix this line }); formPanel = new GeoExt.form.FormPanel({ title: "Place Name Search", height: 150, region: "north", protocol: protocol, items: [{ xtype: "textfield", width: 200, name: "name__like", minLength: 4 }, xtype: "textfield", width: 200, name: "population__ge" ], listeners: { actioncomplete: function(form, action) { features = action.response.features; store.loadData(features); vm=map.getLayersByName("Results"); if(vm.length===0){ vecLayer = new OpenLayers.Layer.Vector("Results"); map.addLayer(vecLayer); store.bind(vecLayer); select.bind(vecLayer); } } }, buttons: [{text: 'search', handler: function(){ formPanel.search(); } }], keys: [{ key: [Ext.EventObject.ENTER], handler: function() { formPanel.search(); } }] }); I tried for all most one week to fix it, but it still not working... When I click to command button "search" it did not show any thing. If some one have experience about this work please write me a command. Thank in advance Quang -------------------------------------------------------------------------------- _______________________________________________ Users mailing list [email protected] http://www.geoext.org/cgi-bin/mailman/listinfo/users
_______________________________________________ Users mailing list [email protected] http://www.geoext.org/cgi-bin/mailman/listinfo/users
