<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div><a href="http://maps.zgb.de:8080/geoserver/www/testing/permalink.html">http://maps.zgb.de:8080/geoserver/www/testing/permalink.html</a></div><div><br></div><div>at the moment I just reset the fields to empty when the user clicks on the vector, but I would obviously like to fill the fieldset form with the corresponding attributes.</div><div><br></div><div>In fact I´d like to lots of other things like use the url in the last field (you have scroll down) on the popup to display an image in the form as well</div><div><br></div><div>Thanks for any tips,</div><div><br></div><div>Robert</div><div><br></div><div><br></div><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><font size="2" face="Tahoma"><hr
size="1"><b><span style="font-weight: bold;">Von:</span></b> Matt Priour <mpriour@kestrelcomputer.com><br><b><span style="font-weight: bold;">An:</span></b> Robert Buckley <robertdbuckley@yahoo.com><br><b><span style="font-weight: bold;">Gesendet:</span></b> Donnerstag, den 31. März 2011, 15:44:40 Uhr<br><b><span style="font-weight: bold;">Betreff:</span></b> Re: [Users] Fill fieldset from grid<br></font><br>
<div><font face="Arial" size="2">I think I would need to see a more fully
functioning example or demo site to understand what is not working here &
how to help</font></div>
<div><font face="Arial" size="2">Matt Priour</font></div>
<div style="FONT:10pt Tahoma;">
<div><br></div>
<div style="BACKGROUND:#f5f5f5;">
<div style=""><b>From:</b> <a rel="nofollow" title="robertdbuckley@yahoo.com" ymailto="mailto:robertdbuckley@yahoo.com" target="_blank" href="mailto:robertdbuckley@yahoo.com">Robert Buckley</a> </div>
<div><b>Sent:</b> Thursday, March 31, 2011 7:45 AM</div>
<div><b>To:</b> <a rel="nofollow" title="users@geoext.org" ymailto="mailto:users@geoext.org" target="_blank" href="mailto:users@geoext.org">users@geoext.org</a> </div>
<div><b>Subject:</b> [Users] Fill fieldset from grid</div></div></div>
<div><br></div>
<div style="FONT-SIZE:12pt;FONT-FAMILY:times new roman, new york, times, serif;">
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;">Hi,</div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;">It´s
probably pretty easy to do, but I can´t find a good way to do this.</div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;">With
this code the map centers in on the feature and the fieldset is populated with
the attributes of a grid (red)</div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">//
1 x Click in grid</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="WHITE-SPACE:pre;"></span>gridPanel.on('rowclick',
function(){</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="WHITE-SPACE:pre;"></span>gridPanel.getSelectionModel().each(function(rec){</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="WHITE-SPACE:pre;"></span>var feature =
rec.get("feature");</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="WHITE-SPACE:pre;"></span><font class="Apple-style-span" color="#ff007f">InfoPanel.getForm().loadRecord(rec);</font></font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="WHITE-SPACE:pre;"></span>mapPanel.map.setCenter(feature.geometry.getBounds().getCenterLonLat(),
12);</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="WHITE-SPACE:pre;"></span>})</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="WHITE-SPACE:pre;"></span>});</font></div></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;">This
is the code to create the popup</div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;">
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">// register a listener for the
feature selection and unselection</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
layer.events.on({</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
featureselected:
function(event){</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
popup = new
GeoExt.Popup({</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
title:
"Feature Attributes",</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
feature:
event.feature,</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
collapsible: true,</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
layout:
"fit",</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
height:
330,</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="WHITE-SPACE:pre;"></span>panIn: true,</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
width:
270,</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="WHITE-SPACE:pre;"></span>unpinnable: true,</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
border:
false,</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
listeners:
{</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
close: function(){</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
select.unselectAll();</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
}</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
},</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
items: [new
Ext.grid.PropertyGrid({</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
autoHeight: true,</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
source: event.feature.attributes</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
})]</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
});</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
popup.show();</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> </font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
},</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
featureunselected:
function(event){</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
popup.destroy();</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
}</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
</font></div>
<div style="FONT-SIZE:10pt;"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
});</font></div></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;">I
want to fill the form also by clicking on the vector features, but cannot see
how to do it. I have tried many things, but they all fail.</div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;">Could
anyone see what I have to do?</div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;">yours,</div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;">Robert</div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"><br></div>
<div style="FONT-SIZE:13px;COLOR:black;FONT-FAMILY:arial, helvetica, sans-serif;"></div></div>
<p>
</p><hr>
<p></p>_______________________________________________<br>Users mailing
list<br>Users@geoext.org<br><span><a target="_blank" href="http://www.geoext.org/cgi-bin/mailman/listinfo/users">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a></span><br>
</div></div><div style="position:fixed"></div>
</div></body></html>