<?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 Re: Remove selections from a FeatureLayer in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/remove-selections-from-a-featurelayer/m-p/646051#M14353</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can call selectFeatures() where the selectionMethod is SELECTION_SUBTRACT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Reference:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/FeatureLayer.html#selectFeatures()"&gt;http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/FeatureLayer.html#selectFeatures()&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Sep 2010 17:31:28 GMT</pubDate>
    <dc:creator>DasaPaddock</dc:creator>
    <dc:date>2010-09-09T17:31:28Z</dc:date>
    <item>
      <title>Remove selections from a FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/remove-selections-from-a-featurelayer/m-p/646050#M14352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was curious if there was a clean way to remove particular selections from a Featurelayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried a couple of different methods to limit the selection to first selected feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought I could cheat and splice the selectedFeatures&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var x:uint = featurelayer.selectedFeatures.length;
featurelayerselectedFeatures.splice(1,x);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;But that didn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I tried to grab the first graphic and make a new FeatureCollection&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var g:Graphic = featurelayer.selectedFeatures[0];
featureLayer.featureCollection = new FeatureCollection(new FeatureSet(&lt;G&gt;));&lt;/G&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;That didn't work either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The next step I suppose would be to use the first graphic geometry to do second selection query on the FeatureLayer, but that seems a bit heavy handed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason I am using FeatureLayer is that this is for a custom component and it is much simpler to pass a FeatureLayer with built in query/selection capabilities than to pass a QueryTask URL and an existing GraphicsLayer on the Map, plus it fits into my workflow as I have some listeners in the main app for when a selection ends on the FeatureLayer being passed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there's no way to tweak the SelectedFeatures after the fact, I'll just go the QueryTask/GraphicsLayer route, but I figure it couldn't hurt to ask.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Sep 2010 14:51:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/remove-selections-from-a-featurelayer/m-p/646050#M14352</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2010-09-09T14:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Remove selections from a FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/remove-selections-from-a-featurelayer/m-p/646051#M14353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can call selectFeatures() where the selectionMethod is SELECTION_SUBTRACT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Reference:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/FeatureLayer.html#selectFeatures()"&gt;http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/FeatureLayer.html#selectFeatures()&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Sep 2010 17:31:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/remove-selections-from-a-featurelayer/m-p/646051#M14353</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2010-09-09T17:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Remove selections from a FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/remove-selections-from-a-featurelayer/m-p/646052#M14354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Aha, that did the trick!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Dasa.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Sep 2010 18:00:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/remove-selections-from-a-featurelayer/m-p/646052#M14354</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2010-09-09T18:00:18Z</dc:date>
    </item>
  </channel>
</rss>

