I am attempting to display the results of my featureset in the GraphicsLayer but nothing is displaying. I know the query is working because of the count on the features in the resulting featureset. <?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"
pageTitle="Salt Lake County Recorder">
<s:layout>
<s:VerticalLayout gap="10"
horizontalAlign="center"
paddingBottom="20"
paddingLeft="25"
paddingRight="25"
paddingTop="20"/>
</s:layout>
<fx:Script>
<![CDATA[
import com.esri.ags.Graphic;
import com.esri.ags.FeatureSet;
import mx.controls.Alert;
import mx.rpc.AsyncResponder;
private function doQuery():void
{
queryTask.execute(query, new AsyncResponder(onResult, onFault));
function onResult(featureSet:FeatureSet, token:Object = null):void
{
// No code needed in this simple sample, since the
// graphiclayer is bound to the query result using
// graphicProvider="{queryTask.executeLastResult.features}"
}
function onFault(info:Object, token:Object = null):void
{
Alert.show(info.toString(), "Query Problem");
}
}
]]>
</fx:Script>[/INDENT]
<fx:Declarations>
<esri:QueryTask id="queryTask"
showBusyCursor="true"
url="http://<mydataurl>/MapServer/4"
useAMF="false" />
<esri:Query id="query"
outSpatialReference="{myMap.spatialReference}"
returnGeometry="true"
where="PARCEL like '%{qText.text}%'">
<!--<esri:Query id="query"
outSpatialReference="{myMap.spatialReference}"
returnGeometry="true"
text="{qText.text}">
-->
<!--where="PARCEL like '0827131011%'"-->
<!---->
</esri:Query>
<esri:InfoSymbol id="infoSymbol1">
<esri:infoRenderer>
<fx:Component>
<mx:VBox>
<mx:Label text="{data.PARCEL}" />
<mx:Label text="{data.own_name}" />
</mx:VBox>
</fx:Component>
</esri:infoRenderer>
</esri:InfoSymbol>
</fx:Declarations>
<s:Panel
height="60"
title="Query a layer (search parcel number)"
backgroundColor="#ECE7E7">
<s:layout>
<s:HorizontalLayout/>
</s:layout>
<s:TextInput id="qText"
enter="doQuery()"
text="0827131011"
width="100%"/>
<s:Button click="doQuery()" label="Do Query" />
</s:Panel>
<esri:Map id="myMap" >
<esri:ArcGISDynamicMapServiceLayer url="http://<mydataurl>/MapServer" />
<!--<esri:GraphicsLayer id="myGraphicsLayer" symbol="{infoSymbol1}" />-->
<esri:GraphicsLayer id="myGraphicsLayer" symbol="{infoSymbol1}" graphicProvider="{queryTask.executeLastResult.features}" />
</esri:Map>
</s:Application>