<esri:QueryTask id="queryTask" url="http://gis.slco.org/wwwrest/services/public/Surveyor/MapServer/2"/>
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:esri="http://www.esri.com/2008/ags" xmlns:tasks="com.esri.ags.tasks.*" xmlns:supportClasses="com.esri.ags.tasks.supportClasses.*"> <s:layout> <s:BasicLayout/> </s:layout> <fx:Declarations> <tasks:QueryTask id="queryTask" url="http://gis.slco.org/wwwrest/services/public/Surveyor/MapServer/2" concurrency="last" useAMF="false"/> <supportClasses:Query id="query" returnGeometry="false" text="{cityName.text}" outFields="*"/> </fx:Declarations> <esri:Map id="map"> <esri:ArcGISDynamicMapServiceLayer url="http://gis.slco.org/wwwrest/services/public/Surveyor/MapServer" /> </esri:Map> <s:Panel title="Using Query tasks without maps"> <s:VGroup> <s:HGroup verticalAlign="middle"> <s:Label text="City Name: " /> <s:TextInput id="cityName" text="Holladay" /> <s:Button label="Get Details" click="queryTask.execute(query);" /> </s:HGroup> <mx:DataGrid id="resultsGrid" dataProvider="{queryTask.executeLastResult.attributes}" visible="{queryTask.executeLastResult != null}" > <mx:columns> <mx:DataGridColumn headerText="City Name" dataField="CITY"/> </mx:columns> </mx:DataGrid> </s:VGroup> </s:Panel> </s:Application>