<?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 Using function for infoTemplate, content is for the wrong feature, only in IE in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-function-for-infotemplate-content-is-for-the/m-p/48342#M4251</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my project, I am using the click event of a featureLayer to executes the function setWindowContent for its infoTemplate.&amp;nbsp; Within that function, it runs a queryAttachmentInfos to get the first image, so I can include it in the tag too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine in Chrome.&amp;nbsp; In IE, the first time I click a feature, I receive an infoWindow with the right contents, but it doesn't use the format function. It displays output as if you set your content as ${*}.&amp;nbsp;&amp;nbsp;&amp;nbsp; Once you click again and for all subsequent clicks, then the format is correct, but the contents are wrong, it's "off" at least one.&amp;nbsp; The information is actually from a feature before, not the one I've just clicked.&amp;nbsp; It doesn't seem to even be just the previous one, sometimes it's two clicks off. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me fix what I'm sure is a scope problem?&amp;nbsp; I'm testing this in IE 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://jsbin.com/wujofi/edit?html,output" title="https://jsbin.com/wujofi/edit?html,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Oct 2015 13:56:22 GMT</pubDate>
    <dc:creator>TracySchloss</dc:creator>
    <dc:date>2015-10-22T13:56:22Z</dc:date>
    <item>
      <title>Using function for infoTemplate, content is for the wrong feature, only in IE</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-function-for-infotemplate-content-is-for-the/m-p/48342#M4251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my project, I am using the click event of a featureLayer to executes the function setWindowContent for its infoTemplate.&amp;nbsp; Within that function, it runs a queryAttachmentInfos to get the first image, so I can include it in the tag too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine in Chrome.&amp;nbsp; In IE, the first time I click a feature, I receive an infoWindow with the right contents, but it doesn't use the format function. It displays output as if you set your content as ${*}.&amp;nbsp;&amp;nbsp;&amp;nbsp; Once you click again and for all subsequent clicks, then the format is correct, but the contents are wrong, it's "off" at least one.&amp;nbsp; The information is actually from a feature before, not the one I've just clicked.&amp;nbsp; It doesn't seem to even be just the previous one, sometimes it's two clicks off. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me fix what I'm sure is a scope problem?&amp;nbsp; I'm testing this in IE 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://jsbin.com/wujofi/edit?html,output" title="https://jsbin.com/wujofi/edit?html,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 13:56:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-function-for-infotemplate-content-is-for-the/m-p/48342#M4251</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2015-10-22T13:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using function for infoTemplate, content is for the wrong feature, only in IE</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-function-for-infotemplate-content-is-for-the/m-p/48343#M4252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I looked at the attributes of the selected feature, they were correct, there was just some issue with using infoTemplate.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I removed infoTemplate as a parameter from my featureLayer, and switched to using just map.infoWindow.&amp;nbsp; It still looks the same, but now it's right in both Chrome and IE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on(featureLayer, "click", function(evt){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.hide();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formatString = "";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var&amp;nbsp; objectId = evt.graphic.attributes[featureLayer.objectIdField];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selectQuery.objectIds = [objectId];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.selectFeatures(selectQuery);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on(featureLayer, 'selection-complete', setWindowContent);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function setWindowContent(results){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var imageString = "&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var imageStyle = "alt='site image' style='height=:40px width:40px float:left'";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var deferred = new Deferred;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic = results.features[0];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var&amp;nbsp; objectId = graphic.attributes[featureLayer.objectIdField]; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.queryAttachmentInfos(objectId).then(function(response){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var imgSrc;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (response.length === 0) {&lt;/P&gt;&lt;P&gt;&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; deferred.resolve("no attachments");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;/P&gt;&lt;P&gt;&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; imgSrc = response[0].url;&lt;/P&gt;&lt;P&gt;&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; imageString += "&amp;lt;td&amp;gt;&amp;lt;img src='" + imgSrc + "' " + imageStyle + "&amp;gt;&amp;lt;/td&amp;gt;";&lt;/P&gt;&lt;P&gt;&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; formatString += imageString;&lt;/P&gt;&lt;P&gt;&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; domConstruct.empty("attachPreviewDiv");&lt;/P&gt;&lt;P&gt;&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; domConstruct.create("img", {&lt;/P&gt;&lt;P&gt;&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; src: imgSrc&lt;/P&gt;&lt;P&gt;&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; }, "attachPreviewDiv");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formatString += "&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;" + graphic.attributes.Facility + "&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;" + graphic.attributes.Address + "&amp;lt;br/&amp;gt;" +&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.attributes.City +&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ", " +&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.attributes.State +&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;lt;td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(formatString);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.setContent(formatString);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.setTitle("&amp;lt;br&amp;gt;");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.show(graphic.geometry); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; map.enableMapNavigation();&lt;/P&gt;&lt;P&gt; }&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 20:43:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-function-for-infotemplate-content-is-for-the/m-p/48343#M4252</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2015-10-27T20:43:45Z</dc:date>
    </item>
  </channel>
</rss>

