[Users] Geoext search?
Zoran Jankovic
zoran.m.jankovic at gmail.com
Sun Feb 14 17:13:20 CET 2010
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
BR,
> ---
> Zoran Jankovic
> ZIS-Izrada softvera i savjetovanje / ZIS - Software Development and
> Consulting
>
> http://www.zisis.hr
>
> M: 00 385 98 682 902
> T: 00 385 44 683 374
>
> A. Senoe 4
> 44320 Kutina
> Croatia
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100214/a4d8a7b2/attachment.htm
More information about the Users
mailing list