<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Extracting attributes from FeatureLayer after selectFeatures() in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/extracting-attributes-from-featurelayer-after/m-p/741695#M16432</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having a little difficulty trying to make this work in a simple manner using a FeatureLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm able to use fLayer.selectFeatures() to make a selection, and features are highlighted on my map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;problem I'm having now is trying to easily extract the attribute data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fLayer.selectedFeatures has all the graphics.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried fLayer.featureCollection.featureSet.attributes, but featureCollection is null when using selectedFeatures. I'm guessing this would get populated when using fLayer.queryFeaturs() maybe? But then my selection doesn't show up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I'm trying to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;fLayer.mode=FeatureLayer.MODE_SELECTION;
fLayer.selectionColor=0x7FFF00;
fLayer.outFields = [ "AssetID", "FeatureID", "Name" ];
fLayer.useAMF=true;
flayer.selectFeatures(query, "new", new AsyncResponder(onFeatureLayerResults_handler, onFault, true)));

function onFeatureLayerResults_handler(features:Array, token:Object = null):void {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // In some way set the dataprovider for a List/Datagrid to the attributes of fLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; // I can iterate the graphics and grab their attributes, but was wondering if there
&amp;nbsp;&amp;nbsp;&amp;nbsp; // was an easier method 
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't had much opportunity to use FeatureLayer up to now as I just got all Desktop/Server running ArcGIS 10, so maybe I'm approaching this the wrong way.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Jul 2010 20:51:17 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2010-07-19T20:51:17Z</dc:date>
    <item>
      <title>Extracting attributes from FeatureLayer after selectFeatures()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/extracting-attributes-from-featurelayer-after/m-p/741695#M16432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having a little difficulty trying to make this work in a simple manner using a FeatureLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm able to use fLayer.selectFeatures() to make a selection, and features are highlighted on my map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;problem I'm having now is trying to easily extract the attribute data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fLayer.selectedFeatures has all the graphics.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried fLayer.featureCollection.featureSet.attributes, but featureCollection is null when using selectedFeatures. I'm guessing this would get populated when using fLayer.queryFeaturs() maybe? But then my selection doesn't show up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I'm trying to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;fLayer.mode=FeatureLayer.MODE_SELECTION;
fLayer.selectionColor=0x7FFF00;
fLayer.outFields = [ "AssetID", "FeatureID", "Name" ];
fLayer.useAMF=true;
flayer.selectFeatures(query, "new", new AsyncResponder(onFeatureLayerResults_handler, onFault, true)));

function onFeatureLayerResults_handler(features:Array, token:Object = null):void {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // In some way set the dataprovider for a List/Datagrid to the attributes of fLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; // I can iterate the graphics and grab their attributes, but was wondering if there
&amp;nbsp;&amp;nbsp;&amp;nbsp; // was an easier method 
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't had much opportunity to use FeatureLayer up to now as I just got all Desktop/Server running ArcGIS 10, so maybe I'm approaching this the wrong way.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jul 2010 20:51:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/extracting-attributes-from-featurelayer-after/m-p/741695#M16432</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2010-07-19T20:51:17Z</dc:date>
    </item>
  </channel>
</rss>

