<?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 Popup, InfoTemplate and setContent with deferred object not supported? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-infotemplate-and-setcontent-with-deferred/m-p/696806#M64873</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been twisting my head with this for several hours, so now I give up...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm implementing Identify on a dynamic service, where the main content comes from a esri.request call (from a different REST endpoint somewhere, based on the ID of the feature). I'm doing it pretty much the same way as the "Indentify - Popup" sample. But on the template I do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var template = new esri.InfoTemplate(); // new esri.dijit.PopupTemplate(); - I've tried both
template.setTitle("Some title");
template.setContent(getInfoWindowContent);
feature.setInfoTemplate(template);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the function generating the content looks exactly like the getTextContent function in the "InfoWindow - Deferred" sample.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I return a string from the getInfoWindowContent function, it works fine. But when I return dojo.Deferred, I get a JavaScript error like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Exception... "Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.appendChild]"&amp;nbsp; nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"&amp;nbsp; location: "JS frame :: &lt;/SPAN&gt;&lt;A href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6" rel="nofollow noopener noreferrer" target="_blank"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6&lt;/A&gt;&lt;SPAN&gt; :: &amp;lt;TOP_LEVEL&amp;gt; :: line 14"&amp;nbsp; data: no]&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6" rel="nofollow noopener noreferrer" target="_blank"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Line 14&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this is not supported, does anyone have any suggestions on how to accomplish this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 05:19:39 GMT</pubDate>
    <dc:creator>Joachim_EckboJuell</dc:creator>
    <dc:date>2021-12-12T05:19:39Z</dc:date>
    <item>
      <title>Popup, InfoTemplate and setContent with deferred object not supported?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-infotemplate-and-setcontent-with-deferred/m-p/696806#M64873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been twisting my head with this for several hours, so now I give up...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm implementing Identify on a dynamic service, where the main content comes from a esri.request call (from a different REST endpoint somewhere, based on the ID of the feature). I'm doing it pretty much the same way as the "Indentify - Popup" sample. But on the template I do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var template = new esri.InfoTemplate(); // new esri.dijit.PopupTemplate(); - I've tried both
template.setTitle("Some title");
template.setContent(getInfoWindowContent);
feature.setInfoTemplate(template);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the function generating the content looks exactly like the getTextContent function in the "InfoWindow - Deferred" sample.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I return a string from the getInfoWindowContent function, it works fine. But when I return dojo.Deferred, I get a JavaScript error like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Exception... "Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.appendChild]"&amp;nbsp; nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"&amp;nbsp; location: "JS frame :: &lt;/SPAN&gt;&lt;A href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6" rel="nofollow noopener noreferrer" target="_blank"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6&lt;/A&gt;&lt;SPAN&gt; :: &amp;lt;TOP_LEVEL&amp;gt; :: line 14"&amp;nbsp; data: no]&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6" rel="nofollow noopener noreferrer" target="_blank"&gt;http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Line 14&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this is not supported, does anyone have any suggestions on how to accomplish this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:19:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-infotemplate-and-setcontent-with-deferred/m-p/696806#M64873</guid>
      <dc:creator>Joachim_EckboJuell</dc:creator>
      <dc:date>2021-12-12T05:19:39Z</dc:date>
    </item>
  </channel>
</rss>

