[Users] Geoext search?
Zoran Jankovic
zoran.m.jankovic at gmail.com
Sun Feb 14 16:30:16 CET 2010
Hi Bart, I would really appreciate any help with this!
Below is the code, for the simplicity of it, it is all in one HTML. You only
have to have Geoext locally...
Javascript is directly copied from GeoExt API example:
http://www.geoext.org/lib/GeoExt/widgets/form/SearchAction.html
When I run this, Firefox error console says:
Errora: Ext.form.Panel is not a constructor
Source file: http://localhost/search_test/search-form.html
Line: 18
---search_test.html-----
<html>
<head>
<script type="text/javascript" src="
http://extjs.cachefly.net/builds/ext-cdn-771.js"></script>
<link rel="stylesheet" type="text/css" href="
http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="
http://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css" />
<script src="http://openlayers.org/api/2.8/OpenLayers.js"></script>
<script type="text/javascript"
src="/GeoExt/script/GeoExt.js"></script>
<script type="text/javascript">
var formPanel = new Ext.form.Panel({
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
}
});
</script>
</head>
<body>
<div id="formpanel" style="float:left;"></div>
</body>
</html>
---
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
On Sun, Feb 14, 2010 at 4:14 PM, Bart van den Eijnden <bartvde at osgis.nl>wrote:
> Hi,
>
> Ext.form.Panel and Ext.form.FormPanel are aliases in Ext, that should not
> be your issue.
>
> Can you post your full non-working example?
>
> Best regards,
> Bart
>
> On Feb 12, 2010, at 1:12 PM, Zoran Jankovic wrote:
>
> Hi list,
> Do I have to emphasize I'm a newbie :-)?
> OK, so as I can see the documentation is a little bit old, some things have
> changed (new ExtJS versions, etc)... But, I'm trying to master searching
> through features. My setup is very simple one, I have some SHP, loaded into
> Geoserver as a layer.
> I was looking into Geoext documentation and found this:
> http://www.geoext.org/lib/GeoExt/widgets/form/SearchAction.html
>
> What JS I have to reference to get this working? I have tried with the
> setup from geoext tutorial, and with my own local Ext-2.3.0, Geoext and
> OpenLayers-2.8, to no effect...
>
> The first problem I can see, in Ext-2.3.0 API documentation there is no
> more
> Ext.form.Panel
> but there is
> Ext.form.FormPanel object
>
> So, if I use my setup from the basic example (so I now it loads ExtJS
> 2.3.0, geoext 0.6 and OpenLayers 2.8) I get what is basically a blank page
> (only what I add as HTML is rendered), Firefox Error Console gives a bunch
> of warnings and 1 error:
>
> Error: Ext.form.Panel is not a constructor
> Source File: http://localhost/trazenje/
> Line: 22
>
> And if I try changing Ext.form.Panel to Ext.form.Formpanel I get:
>
> Error: ct is null
> Source File: http://localhost/ext-2.3.0/ext-all.js
> Line: 1140
>
> Needles to say my Javascript knowledge is limited, but I was under the
> (probably false ;-) ) impression that I would at least be able to run some
> examples :-(.
> Where is the error? What should be in <head> to be able to run this
> example?
>
>
> ---
> Zoran
>
> _______________________________________________
> 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/20100214/b4a8d722/attachment.htm
More information about the Users
mailing list