<?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: Popup content with deferred object in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-content-with-deferred-object/m-p/694806#M64644</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you put your code on &lt;A href="http://jsfiddle.net/"&gt;JSFiddle&lt;/A&gt; or &lt;A href="http://plnkr.co/" title="http://plnkr.co/"&gt;Plunker&lt;/A&gt;? If people can see your code running in such an environment it will be a lot more likely that someone will figure out the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Sep 2015 21:29:19 GMT</pubDate>
    <dc:creator>JeffJacobson</dc:creator>
    <dc:date>2015-09-10T21:29:19Z</dc:date>
    <item>
      <title>Popup content with deferred object</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-content-with-deferred-object/m-p/694804#M64642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to display attribute infos and attachment in popup &lt;BR /&gt;window. It can be quite good handled by code selected as correct answer &lt;BR /&gt;here (&lt;A _jive_internal="true" href="https://community.esri.com/thread/159806" rel="nofollow"&gt;https://community.esri.com/thread/159806&lt;/A&gt;).&lt;BR /&gt;&amp;nbsp; Basically you create two event handlers for “click” and &lt;BR /&gt;“query-attachment-infos-complete“ and in second one you set content of &lt;BR /&gt;infoTemplate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem with this approach is somehow „cosmetical“, but I would &lt;BR /&gt;like to solve it. If you click two features that are close enough to &lt;BR /&gt;each other you get a popup with label like „1/2“ and arrow that is &lt;BR /&gt;supposed to switch popup conten to feature „2/2“. The problem is that on&lt;BR /&gt; feature 2/2 the content (attachement url, or thumbnail) is the same as &lt;BR /&gt;for feature 1/2 . It is probably because in handler for &lt;BR /&gt;“query-attachment-infos-complete“&amp;nbsp; you set infoTemplate.content for one &lt;BR /&gt;feature and that infoTemplate is used for second feature as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I am wondering if this could not be better solved with similar approach as in the tutorial here:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/jshelp/intro_formatinfowindow.html" rel="nofollow"&gt;https://developers.arcgis.com/javascript/jshelp/intro_formatinfowindow.html&lt;/A&gt;&lt;BR /&gt; (at the bottom of the page, after Deferred Object bullet).&lt;BR /&gt;In this approach you set content for infoWindow by function, let’s call &lt;BR /&gt;it getTextContent(graphic). And inside this function you can run method &lt;BR /&gt;featureLayer. queryAttachmentInfos(OBJECTID) which return value is &lt;BR /&gt;deferred object. So you can implement callback function and get &lt;BR /&gt;attachement url. I am just totally lame to get attachement url from that&lt;BR /&gt; callback function into return variable for getTextContent function. The&lt;BR /&gt; scratch version is like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;function getTextContent(graphic)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; var deferred = editLayer.queryAttachmentInfos(&lt;BR /&gt;&amp;nbsp; graphic.attributes.OBJECTID, &lt;BR /&gt;&amp;nbsp; function (attachemntInfos)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; var attachmentUrl = attachemntInfos[0].url;&lt;BR /&gt;&amp;nbsp; return attachmentUrl;&lt;BR /&gt;&amp;nbsp; }); &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; //I wish this would be attachmentUrl...&lt;BR /&gt;&amp;nbsp; return ???attachmentUrl &lt;BR /&gt;&lt;BR /&gt;}&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help,idea, comment would by very appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2015 05:06:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-content-with-deferred-object/m-p/694804#M64642</guid>
      <dc:creator>MichaelKefahuchi</dc:creator>
      <dc:date>2015-07-29T05:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Popup content with deferred object</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-content-with-deferred-object/m-p/694805#M64643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;More than one month without answer? Come one, at least tell me that it is bad approach and it won' work or something &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2015 06:53:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-content-with-deferred-object/m-p/694805#M64643</guid>
      <dc:creator>MichaelKefahuchi</dc:creator>
      <dc:date>2015-09-10T06:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Popup content with deferred object</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-content-with-deferred-object/m-p/694806#M64644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you put your code on &lt;A href="http://jsfiddle.net/"&gt;JSFiddle&lt;/A&gt; or &lt;A href="http://plnkr.co/" title="http://plnkr.co/"&gt;Plunker&lt;/A&gt;? If people can see your code running in such an environment it will be a lot more likely that someone will figure out the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2015 21:29:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-content-with-deferred-object/m-p/694806#M64644</guid>
      <dc:creator>JeffJacobson</dc:creator>
      <dc:date>2015-09-10T21:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Popup content with deferred object</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-content-with-deferred-object/m-p/694807#M64645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff, thank you for your suggestion. Here is fiddle &lt;A href="https://jsfiddle.net/kefahuchi/esc88t43/1/" title="https://jsfiddle.net/kefahuchi/esc88t43/1/"&gt;https://jsfiddle.net/kefahuchi/esc88t43/1/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I basically used esri sample for this fiddle, the important part for me is "getInfoText" function, e.g. lines 36 -65. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2015 07:22:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-content-with-deferred-object/m-p/694807#M64645</guid>
      <dc:creator>MichaelKefahuchi</dc:creator>
      <dc:date>2015-09-11T07:22:12Z</dc:date>
    </item>
  </channel>
</rss>

