[Users] Geoext search?
Eric Lemoine
eric.lemoine at camptocamp.com
Mon Feb 15 14:12:04 CET 2010
On Sun, Feb 14, 2010 at 5:13 PM, Zoran Jankovic
<zoran.m.jankovic at gmail.com> wrote:
>
>
>
> On Sun, Feb 14, 2010 at 4:56 PM, Bart van den Eijnden <bartvde at osgis.nl>
> wrote:
>>
>> Hi Zoran,
>> ok, I see now, indeed you need to use Ext.form.FormPanel, ignore my
>> previous post about that.
>> The other problem you reported (ct is undefined), is because you are
>> running your javascript code before the DOM is ready, and your div is simply
>> not yet there. So use Ext.onReady instead to wrap your code, something like:
>> Ext.onReady(
>> function() {
>> var formPanel = new Ext.form.FormPanel({
>> renderTo: "formpanel",
>> items: [{
>> xtype: "textfield",
>> name: "name__like",
>> value: "mont"
>> }, {
>> xtype: "textfield",
>> name: "elevation__ge",
>> value: "2000"
>> }]
>> });
>> var searchAction = new GeoExt.form.SearchAction(formPanel.getForm(), {
>> protocol: new OpenLayers.Protocol.WFS({
>> url: "http://publicus.opengeo.org/geoserver/wfs",
>> featureType: "tasmania_roads",
>> featureNS: "http://www.openplans.org/topp"
>> }),
>> abortPrevious: true
>> });
>> formPanel.getForm().doAction(searchAction, {
>> callback: function(response) {
>> // response.features includes the features read
>> // from the server through the protocol
>> }
>> });
>> });
>> Best regards,
>> Bart
>>
> OK, now we are getting somewhere :-). Finally I have something rendered in
> my DIV, although it's just two text fields, now at least I'm making some
> progress...
> Is there _anywhere_ a working example of this Search action? As I in a
> previous post, I have SHP as a layer in Geoserver, and I need to search
> through "names" attribute and display the result...
> I found Geonames example, but it's a definitive overkill for my needs, at
> least for now, and at this stadia of JS knowledge ;-).
> BTW, that link "Test it!" under geoext.blogspot.com (UX introduction) is
> also broken:
> http://dev.geoext.org/ux/GeoNamesSearchCombo/examples/GeoNamesSearchComboExample.html
> Previous link will get you nowhere, you have to start from
> http://dev.geoext.org/ux and work your way through to find this example:
> http://dev.geoext.org/ux/geoext.ux/ux/GeoNamesSearchCombo/examples/GeoNamesSearchComboExample.html
Yes, the structure of the SVN has changed for the ux recently, try
<http://dev.geoext.org/extensions/geoext.ux/ux/GeoNamesSearchCombo/examples/GeoNamesSearchComboExample.html>.
Sorry for the inconvenience.
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
More information about the Users
mailing list