<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=utf-8>
<STYLE type=text/css><!-- DIV {margin:0px;} --></STYLE>
<META content="MSHTML 6.00.6002.18309" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" leftMargin=0
topMargin=0 CanvasTabStop="true" name="Compose message area">
<DIV><FONT face=Arial size=2>I have a WFSSearchForm that I built that I thought
would be a good fit, but looking into it, I see that there are a lot of specific
assumptions and simplifications that essentially recreates the logic of the
GeoExt.form.FormPanel but in a much less flexible way. So I would instead
suggest a panel which combines a GeoExt.form.FormPanel and a feature
grid.</FONT></DIV>
<DIV><FONT face=Arial size=2>The following code is combined from the GeoExt
examples but is untested</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>...</FONT></DIV>
<DIV><FONT face=Arial size=2>var vecLayer = new
OpenLayers.Layer.Vector('myVectorLayer');<BR>var
store,gridPanel,formPanel,mainPanel</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>// create feature store, binding it to the vector
layer<BR>store = new GeoExt.data.FeatureStore({<BR> layer:
vecLayer,<BR> fields:
[<BR> {name: 'name', type:
'string'},<BR> {name: 'elevation',
type: 'float'}<BR> ],<BR> proxy: new
GeoExt.data.ProtocolProxy({<BR>
protocol: new
OpenLayers.Protocol.WFS({<BR>
url: "<A
href="http://my.wfs">http://my.wfs</A>",<BR>
outputFormat: new OpenLayers.Format.GeoJSON()<BR> //, ... other
wfs options ...<BR>
})<BR> }),<BR> autoLoad:
false<BR>});</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>// create grid panel configured with feature
store<BR>gridPanel = new Ext.grid.GridPanel({<BR> title:
"Feature Grid",<BR> anchor: "100% 50%",<BR>
store: store,<BR> columns:
[{<BR> header:
"Name",<BR> width:
200,<BR> dataIndex:
"name"<BR> }, {<BR>
header: "Elevation",<BR> width:
100,<BR> dataIndex:
"elevation"<BR> }],<BR> sm: new
GeoExt.grid.FeatureSelectionModel() <BR>});</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>// create form panel configured with the feature
store's protocol<BR>formPanel = new GeoExt.form.FormPanel({<BR> anchor:
'100% 50%',<BR> protocol: store.proxy.protocol,<BR> items:
[{<BR> xtype: "textfield",<BR> name:
"name__like",<BR> fieldLabel: "Name"<BR> },
{<BR> xtype: "textfield",<BR> name:
"elevation__ge",<BR> fieldLabel: "Max
Elevation"<BR> }],<BR> buttons: [{<BR> text:
'Search',<BR> handler: function(){<BR> //hiding
inside a function to change scope to formPanel<BR> //perform
the formPanel's default filtered search
action<BR> this.search();<BR> }<BR> }]<BR>});</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>// create main panel<BR>mainPanel = new
Ext.Window({<BR> title:'A Filtered Attribute Search
Form',<BR> layout:'anchor',<BR> closeAction:'hide',<BR> closeable:true,<BR> items:[formPanel,gridPanel]<BR>})</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>mainPanel.show();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>.....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Hope that helps</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Matt Priour</FONT></DIV>
<DIV><FONT face=Arial size=2>Kestrel Computer Consulting</DIV>
<DIV><BR></DIV></FONT>
<DIV style="FONT: 10pt Tahoma">
<DIV><FONT face=Arial></FONT><FONT face=Arial></FONT><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A
title="mailto:robertdbuckley@yahoo.com CTRL + Click to follow link"
href="mailto:robertdbuckley@yahoo.com">Robert Buckley</A> </DIV>
<DIV><B>Sent:</B> Tuesday, November 02, 2010 2:15 AM</DIV>
<DIV><B>To:</B> <A
title="mailto:users@geoext.org CTRL + Click to follow link"
href="mailto:users@geoext.org">users@geoext.org</A> </DIV>
<DIV><B>Subject:</B> [Users] Search functionality with GeoExt but without
Mapfish</DIV></DIV></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR></DIV>
<DIV
style="FONT-SIZE: 8pt; FONT-FAMILY: arial,helvetica,sans-serif">Hi,<BR><BR>I
would like to have a search capability in a geoext project but I do not have
Mapfish installed. <BR>Are there any Geoext examples regarding searching through
datasets coming from geoserver, <BR>or any code snippets showing how to
implement such a function using either shapefiles or
postgis?<BR><BR>yours,<BR><BR>Robert Buckley<BR>
<DIV><FONT size=2></FONT><FONT size=2></FONT><BR></DIV></DIV><BR>
<P></P><FONT face=Arial></FONT><FONT face=Arial></FONT>
<HR>
<P></P>_______________________________________________<BR>Users mailing
list<BR>Users@geoext.org<BR>http://www.geoext.org/cgi-bin/mailman/listinfo/users<BR></BODY></HTML>