ok,after some more research and trial and error, I have gotten it to pass something to the next view using the Query Task Declaration with this code:
<fx:Script>
<![CDATA[
import com.esri.ags.events.FeatureLayerEvent;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.layers.TiledMapServiceLayer;
import mx.controls.Alert;
import mx.events.FlexEvent;
public function layerShowHandler(event:FlexEvent):void
{
var tiledLayer:TiledMapServiceLayer = event.target as TiledMapServiceLayer;
myMap.lods = tiledLayer.tileInfo.lods;
}
public function map_mapClickHandler(event:MapMouseEvent):void
{
// set the selection query based on the click
queryMapClick.geometry = event.mapPoint;
dataMap.selectFeatures(queryMapClick); // default selectionMethod is FeatureLayer.SELECTION_NEW
myMap.infoWindow.hide();
}
protected function myFeatureLayer_selectionCompleteHandler(event:FeatureLayerEvent):void
{
if (event.featureLayer.numGraphics > 0)
{
queryTask.execute(queryMapClick);
}
else
{
Alert.show("Sorry found nothing here...");
}
}
]]>
</fx:Script>
<fx:Declarations>
<esri:QueryTask id="queryTask"
executeComplete="navigator.pushView(EditorView2, event.featureSet)"
showBusyCursor="false"
url="http://rta-gis:6080/arcgis/rest/services/temp/trial/MapServer/0"/>
<esri:Query id="queryMapClick"
outFields="[Stopid]"
returnGeometry="false"/>
</fx:Declarations>
After I select an item and when it goes to the next view it is shows up as [object:Object] when I run the app. Am I missing a data bind or is something not defined? Here is my code for View2.
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:esri="http://www.esri.com/2008/ags"
title="EditorView2">
<fx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import mx.collections.ArrayList;
import mx.collections.IList;
[Bindable]
private var listProvider:IList;
override public function set data(value:Object):void
{
super.data = value;
const featureSet:FeatureSet = value as FeatureSet;
if (featureSet)
{
listProvider = new ArrayList(featureSet.attributes);
}
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:List id="list"
left="0" right="0" top="0" bottom="0"
dataProvider="{listProvider}"
interactionMode="touch"
labelField="StopID"/>
<s:Button x="174" y="141" label="Go Back" click="navigator.activeView.navigator.popView()"/>
</s:View>