<?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 Edit invisible featurelayer in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/edit-invisible-featurelayer/m-p/415750#M9711</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I work around this sample: &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/flex/sample-code/editor.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/flex/sample-code/editor.htm&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want to do is to make existing features invisible, but the editor should stay enabled to add new features. Added features should stay visible during running browser sesion.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to do like in the code below, but this disables editor for this layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;esri:FeatureLayer id="incidentsAreas" visible="false"
 mode="snapshot"
 url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/2"/&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there other solution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrzej&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:50:42 GMT</pubDate>
    <dc:creator>AndrzejMilosz</dc:creator>
    <dc:date>2021-12-11T18:50:42Z</dc:date>
    <item>
      <title>Edit invisible featurelayer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/edit-invisible-featurelayer/m-p/415750#M9711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I work around this sample: &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/flex/sample-code/editor.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/flex/sample-code/editor.htm&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want to do is to make existing features invisible, but the editor should stay enabled to add new features. Added features should stay visible during running browser sesion.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to do like in the code below, but this disables editor for this layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;esri:FeatureLayer id="incidentsAreas" visible="false"
 mode="snapshot"
 url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/2"/&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there other solution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrzej&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:50:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/edit-invisible-featurelayer/m-p/415750#M9711</guid>
      <dc:creator>AndrzejMilosz</dc:creator>
      <dc:date>2021-12-11T18:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Edit invisible featurelayer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/edit-invisible-featurelayer/m-p/415751#M9712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Andrzej,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; The layer has to be visible to be edited. So you would have to apply a definitionExpression to the FeatureLayer and the expression would have to something like 'NOT ObjectId IN (1,2,3,etc)' an feed the expression the list of current objectids. You would be the list of current ObjectIds by doing an QueryTask.executeForIds&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some thing like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; private var query:Query = new Query;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private var queryTask:QueryTask = new QueryTask();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.outFields = ["objectid"]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.objectIds = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = "1=1";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.url = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/2";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.executeForIds(query, new AsyncResponder(onExecuteForIdsComplete, queryTask_faultHandler));

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private function onExecuteForIdsComplete(objectIds:Array, token:Object = null):void
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Apply a definition expression that removes all the current objectids
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Now you should only have the new features you create visible
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; incidentsAreas.definitionExpression = "NOT objectid IN (" + objectIds.join(',') + ")";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private function queryTask_faultHandler(info:Object, token:Object = null):void
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //do nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:50:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/edit-invisible-featurelayer/m-p/415751#M9712</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T18:50:45Z</dc:date>
    </item>
  </channel>
</rss>

