<?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: FeatureLayer.SELECTION_ADD - am I doing this wrong? in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-selection-add-am-i-doing-this-wrong/m-p/149154#M3449</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nevermind. This works as intended. I was able to track down the issue in my application to a bug in my library that cleared all GraphicsLayers on varying events, including before I ran my FeatureLayer query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My bad, thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Mar 2012 13:15:46 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2012-03-14T13:15:46Z</dc:date>
    <item>
      <title>FeatureLayer.SELECTION_ADD - am I doing this wrong?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-selection-add-am-i-doing-this-wrong/m-p/149153#M3448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I recently tried updating an app to allow adding selections to a FeatureLayer. This is using the 2.4 Flex API (want to avoid updating for the moment).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not doing any editing, I'm just loading the FeatureLayer with a service url like so&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://internalserver/ArcGIS/rest/services/SewerFeatures/MapServer/4" rel="nofollow noopener noreferrer" target="_blank"&gt;http://internalserver/ArcGIS/rest/services/SewerFeatures/MapServer/4&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;I create my FeatureLayer like so&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
fLayer.mode = FeatureLayer.MODE_SELECTION
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/44940-Help-with-Feature-Layer-SELECTION_SUBTRACT?highlight=SELECTION_ADD" rel="nofollow noopener noreferrer" target="_blank"&gt;This thread&lt;/A&gt;&lt;SPAN&gt; suggests that I should use FeatureLayer.SELECTION_ADD when initializing, but when I did that, no selections worked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, I can do a selection using the default "new"&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
fLayer.selectFeatures( query, FeatureLayer.SELECTION_NEW, new AsyncResponder( onSewerFeaturesSelected, onFault ));
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then when I try to add to this selection at some point after the results are shown&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
fLayer.selectFeatures( query, FeatureLayer.SELECTION_ADD, new AsyncResponder( onSewerFeaturesSelected, onFault ));
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It doesn't add new features to the selection, it just does a new selection and clears what was previously selected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These queries are being done via a geometry if that matters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe I'm misunderstanding what FeatureLayer.SELECTION_ADD does when in FeatureLayer.MODE_SELECTION.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can probably work around it by saving my selected graphics and adding them back, but I would think the above method should work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:04:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-selection-add-am-i-doing-this-wrong/m-p/149153#M3448</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-11T08:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.SELECTION_ADD - am I doing this wrong?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-selection-add-am-i-doing-this-wrong/m-p/149154#M3449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nevermind. This works as intended. I was able to track down the issue in my application to a bug in my library that cleared all GraphicsLayers on varying events, including before I ran my FeatureLayer query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My bad, thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2012 13:15:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-selection-add-am-i-doing-this-wrong/m-p/149154#M3449</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2012-03-14T13:15:46Z</dc:date>
    </item>
  </channel>
</rss>

