<?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: callback for applyEdits not working in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/callback-for-applyedits-not-working/m-p/582200#M54348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the documentation you linked, you'll notice that applyEdits returns a deferred. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit your code to handle the deferred... try something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myLayer.applyEdits(null, [updateFeature], null).then(function(addResponse, updateResponse, deleteResponse){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(addResponse, updateResponse, deleteResponse); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NOTE: Only updateResponse will have data (since you did not add or delete, both addResponse and deleteResponse will be null).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;*edit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I also want to mention that you linked to the old style (legacy) documentation of FeatureLayer. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would recommend switching over to AMD style.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jan 2014 14:42:46 GMT</pubDate>
    <dc:creator>JonathanUihlein</dc:creator>
    <dc:date>2014-01-14T14:42:46Z</dc:date>
    <item>
      <title>callback for applyEdits not working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/callback-for-applyedits-not-working/m-p/582197#M54345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I added a 'save' button to my attribute inspector, and upon clicking it I'd like for the feature layer to update and then close the info window (a similar effect to when you hit the attribute inspector's 'delete' button). I followed the documentation (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/en/javascript/jsapi/featurelayer.html#applyedits" rel="nofollow" target="_blank"&gt;https://developers.arcgis.com/en/javascript/jsapi/featurelayer.html#applyedits&lt;/A&gt;&lt;SPAN&gt;)and came up with the following statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;updateFeature.getLayer().applyEdits(null, [updateFeature], null, function(){&amp;nbsp; map.infoWindow.hide();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The update is fine but the callback does not occur. The syntax looks correct to me, I don't see the need to supply any arguments to the callback, so I don't know what the problem could be&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2014 13:39:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/callback-for-applyedits-not-working/m-p/582197#M54345</guid>
      <dc:creator>KaitlynnDavis</dc:creator>
      <dc:date>2014-01-14T13:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: callback for applyEdits not working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/callback-for-applyedits-not-working/m-p/582198#M54346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try adding a 2nd function after the callback to listen for a possible error and see if there is more information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;updateFeature.getLayer().applyEdits(null, [updateFeature], null, function(){
 map.infoWindow.hide();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
}, function(err) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.warn('Error occured: ', err);
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:01:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/callback-for-applyedits-not-working/m-p/582198#M54346</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-12T01:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: callback for applyEdits not working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/callback-for-applyedits-not-working/m-p/582199#M54347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to handle the error and no warnings were issued in Firebug, but thank you for the good suggestion&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2014 14:10:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/callback-for-applyedits-not-working/m-p/582199#M54347</guid>
      <dc:creator>KaitlynnDavis</dc:creator>
      <dc:date>2014-01-14T14:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: callback for applyEdits not working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/callback-for-applyedits-not-working/m-p/582200#M54348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the documentation you linked, you'll notice that applyEdits returns a deferred. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit your code to handle the deferred... try something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myLayer.applyEdits(null, [updateFeature], null).then(function(addResponse, updateResponse, deleteResponse){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(addResponse, updateResponse, deleteResponse); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NOTE: Only updateResponse will have data (since you did not add or delete, both addResponse and deleteResponse will be null).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;*edit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I also want to mention that you linked to the old style (legacy) documentation of FeatureLayer. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would recommend switching over to AMD style.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2014 14:42:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/callback-for-applyedits-not-working/m-p/582200#M54348</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2014-01-14T14:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: callback for applyEdits not working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/callback-for-applyedits-not-working/m-p/582201#M54349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@ jon.uihlein, it has been a while but your suggestion was what ended up working for me. I used the then() callback to close my infoWindow immediately after the applyEdits function executes. Thanks for your help&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 13:25:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/callback-for-applyedits-not-working/m-p/582201#M54349</guid>
      <dc:creator>KaitlynnDavis</dc:creator>
      <dc:date>2014-02-18T13:25:00Z</dc:date>
    </item>
  </channel>
</rss>

