<?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 PopupTemplate JavaScript promise for the contents is never being executed. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696880#M64876</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Summary:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My PopupTemplate JavaScript promise for the contents is never being executed.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Requirements:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am attempting to code a feature that will allow the user to click on a graphic in a Feature Layer and see a popup. We have integrated the map into our ASP.Net MVC web application using the &lt;STRONG&gt;JavaScript 4.5 API.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have coded the popup in JavaScript as a Popup Template. When the user clicks on a graphic (that will&amp;nbsp;represent a map pin-point), I need the code to do an (asynchronous) AJAX HTTP GET to an endpoint in order to retrieve a JSON object. The object will contain some data that will be displayed in the popup.&lt;/P&gt;&lt;P&gt;I have assigned the 'content' property of my PopupTemplate to my JavaScript function that returns a promise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It appears that the promise is never being executed, as&amp;nbsp;breakpoints in my code within the promise are never hit.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried several ways to code the promise with no success. I am using esriRequest to actually do the AJAX GET, and returning the promise from this as the function assignment. Please see my attached code.&lt;/P&gt;&lt;P&gt;I think the JavaScript API is just executing my function and ignoring the promise that I am returning.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2017 11:15:31 GMT</pubDate>
    <dc:creator>AndrewPage1</dc:creator>
    <dc:date>2017-12-06T11:15:31Z</dc:date>
    <item>
      <title>PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696880#M64876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Summary:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My PopupTemplate JavaScript promise for the contents is never being executed.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Requirements:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am attempting to code a feature that will allow the user to click on a graphic in a Feature Layer and see a popup. We have integrated the map into our ASP.Net MVC web application using the &lt;STRONG&gt;JavaScript 4.5 API.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have coded the popup in JavaScript as a Popup Template. When the user clicks on a graphic (that will&amp;nbsp;represent a map pin-point), I need the code to do an (asynchronous) AJAX HTTP GET to an endpoint in order to retrieve a JSON object. The object will contain some data that will be displayed in the popup.&lt;/P&gt;&lt;P&gt;I have assigned the 'content' property of my PopupTemplate to my JavaScript function that returns a promise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It appears that the promise is never being executed, as&amp;nbsp;breakpoints in my code within the promise are never hit.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried several ways to code the promise with no success. I am using esriRequest to actually do the AJAX GET, and returning the promise from this as the function assignment. Please see my attached code.&lt;/P&gt;&lt;P&gt;I think the JavaScript API is just executing my function and ignoring the promise that I am returning.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 11:15:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696880#M64876</guid>
      <dc:creator>AndrewPage1</dc:creator>
      <dc:date>2017-12-06T11:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696881#M64877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you adding esriRequest as AMD? because cannot see the esriRequest module is loaded anywhere in your code.&lt;/P&gt;&lt;P&gt;Also is the code before esriRequest executing?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mohammad Ashraf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 12:13:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696881#M64877</guid>
      <dc:creator>AshrafDar</dc:creator>
      <dc:date>2017-12-06T12:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696882#M64878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Further up in the code (not uploaded to you) I am loading the esriRequest as follows:&lt;/P&gt;&lt;P&gt;require([&lt;BR /&gt; "esri/Map",&lt;BR /&gt; ...&lt;BR /&gt; "esri/request",&lt;BR /&gt; "dojo/Deferred"&lt;BR /&gt; ], function (Map, ... esriRequest, Deferred) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;&lt;SPAN&gt;esriRequest and Deferred objects are in-scope to the functions I have uploaded to you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The code before the esriRequest is executing&amp;nbsp;ok (each time that the user clicks a map point / graphic).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 13:35:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696882#M64878</guid>
      <dc:creator>AndrewPage1</dc:creator>
      <dc:date>2017-12-06T13:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696883#M64879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You can try using otherwise to see if the esriRequest is failing:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&amp;nbsp; &lt;SPAN class="token function"&gt;esriRequest&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;url&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; options&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;then&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;response&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// do something useful&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;otherwise&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;error&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"informative error message: "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; error&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:19:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696883#M64879</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T05:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696884#M64880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you add failure callback and log the message returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mohammad Ashraf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 13:53:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696884#M64880</guid>
      <dc:creator>AshrafDar</dc:creator>
      <dc:date>2017-12-06T13:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696885#M64881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your responses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the exact block of code above with 'otherwise' and neither the 'then' nor the 'otherwise' are ever called. No request is actually made (according to the Chrome Network tab). It seems that the code that calls my function (buried in the API) never calls the promise I am returning (as far as I can see).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 14:06:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696885#M64881</guid>
      <dc:creator>AndrewPage1</dc:creator>
      <dc:date>2017-12-06T14:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696886#M64882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Based on this sample:&amp;nbsp;&lt;A class="link-bare" href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=popuptemplate-promise" title="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=popuptemplate-promise" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=popuptemplate-promise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The esriRequest is a Promise return type so you need to do something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;setPopupContent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;target&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; locationId &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; target&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ObjectID&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; url &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urlGetLocationExtendedPointsData &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'/'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; locationId&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; options &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; query&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'json'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; responseType&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'json'&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;esriRequest&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;url&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; options&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;then&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;response&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// THIS CODE IS NEVER EXECUTED!&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; source &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;$&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"#map-popup-content-template"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;html&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; template &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Handlebars&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;compile&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;source&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; context &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; RiskQualityChartTitle&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Chart title"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; html &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;template&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;context&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:19:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696886#M64882</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T05:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696887#M64883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have just tried setting the block to be as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function setPopupContent(target) {&lt;BR /&gt; var locationId = target.graphic.attributes.ObjectID;&lt;BR /&gt; var url = urlGetLocationExtendedPointsData + '/' + locationId;&lt;BR /&gt; var options = {&lt;BR /&gt; query: {&lt;BR /&gt; f: 'json'&lt;BR /&gt; },&lt;BR /&gt; responseType: 'json'&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;return esriRequest(url, options).then(function (response) {&lt;BR /&gt; // THIS CODE IS NEVER EXECUTED!&lt;BR /&gt; var source = $("#map-popup-content-template").html();&lt;BR /&gt; var template = Handlebars.compile(source);&lt;BR /&gt; var context = { RiskQualityChartTitle: "Chart title" }&lt;BR /&gt; var html = template(context);&lt;BR /&gt; return html;&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The block starting '&lt;SPAN&gt;THIS CODE IS NEVER EXECUTED' is still never executed, with no message appearing in the console.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 14:33:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696887#M64883</guid>
      <dc:creator>AndrewPage1</dc:creator>
      <dc:date>2017-12-06T14:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696888#M64884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I would try making your code more like the sample as far as defining the popupTemplate when you create the layer:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// USA counties layer&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; countiesLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fservices.arcgis.com%2FP3ePLMYs2RVChkJx%2FArcGIS%2Frest%2Fservices%2FUSA_Counties%2FFeatureServer%2F0" target="_blank"&gt;https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Counties/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minScale&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxScale&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; renderer&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// create a new popupTemplate for the layer&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; popupTemplate&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// autocasts as new PopupTemplate()&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; title&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"County of {NAME}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; content&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; queryBlockGroups
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:19:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696888#M64884</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T05:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696889#M64885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have just tried this - and there is no difference. Thanks anyway. Any other suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 15:46:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696889#M64885</guid>
      <dc:creator>AndrewPage1</dc:creator>
      <dc:date>2017-12-06T15:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696890#M64886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Have you tried to change the&amp;nbsp;setPopupContent function to just return some simple string (just for testing)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 15:49:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696890#M64886</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-12-06T15:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696891#M64887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it works fine when it is just a simple function that returns some HTML. I am having this problem because I want to do an async request. In this scenario, there does not seem to be a way to get the API to actually execute the promise that I am returning.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 15:52:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696891#M64887</guid>
      <dc:creator>AndrewPage1</dc:creator>
      <dc:date>2017-12-06T15:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696892#M64888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That is strange because the sample I linked to is using a promise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696892#M64888</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-12-06T16:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696893#M64889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any difference between the promise returned from&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;return queryBlocksTask.execute(query).then(function(result)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;return esriRequest(url, options).then(function (response)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:07:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696893#M64889</guid>
      <dc:creator>AndrewPage1</dc:creator>
      <dc:date>2017-12-06T16:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696894#M64890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that is very likely it all depends on that the service is returning and how it it returning it. Have you tested just doing the esriRequest somewhere else in your code like just adding it to the main code block so you can debug if the request is ever working?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:12:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696894#M64890</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-12-06T16:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696895#M64891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have got it working by reverting back to using JQuery:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function setPopupContent(target) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var locationId = target.graphic.attributes.ObjectID;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var url = urlGetLocationExtendedPointsData + '/' + locationId;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return $.get(url).then(function(data) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var source = $("#map-popup-content-template").html();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var template = Handlebars.compile(source);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var context = { RiskQualityChartTitle: data.SiteName }&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var html = template(context);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return html;&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason the esriRequest was not working. Thanks for your help anyway.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:53:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696895#M64891</guid>
      <dc:creator>AndrewPage1</dc:creator>
      <dc:date>2017-12-06T16:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate JavaScript promise for the contents is never being executed.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696896#M64892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This behavior (or lack thereof) also exists at 4.6 bug&amp;nbsp;4.x&amp;nbsp;esrirequest&amp;nbsp;popuptemplate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2018 19:53:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-javascript-promise-for-the-contents/m-p/696896#M64892</guid>
      <dc:creator>BrandonFlessner</dc:creator>
      <dc:date>2018-03-19T19:53:27Z</dc:date>
    </item>
  </channel>
</rss>

