<?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 Retrieve attributes of a feature when clicked in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/retrieve-attributes-of-a-feature-when-clicked/m-p/667253#M62312</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;Here is a screenshot of my map, where a feature in the map is clicked and an InfoTemplate is displaying the attributes for that feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14527[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want to do is when I click one of the buttons in my InfoTemplate, I want to save the attributes of the feature I just clicked moments before. How do I know what feature I just clicked?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One idea I had was maybe assign a click handler for the layer graphics, but since the features are obtained from a REST map service (which is an asynchronous request) I cannot figure out when to make this assignment since I don't know exactly when the graphics have all been added to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2012 19:43:02 GMT</pubDate>
    <dc:creator>YohanBienvenue</dc:creator>
    <dc:date>2012-05-22T19:43:02Z</dc:date>
    <item>
      <title>Retrieve attributes of a feature when clicked</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/retrieve-attributes-of-a-feature-when-clicked/m-p/667253#M62312</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;Here is a screenshot of my map, where a feature in the map is clicked and an InfoTemplate is displaying the attributes for that feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14527[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want to do is when I click one of the buttons in my InfoTemplate, I want to save the attributes of the feature I just clicked moments before. How do I know what feature I just clicked?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One idea I had was maybe assign a click handler for the layer graphics, but since the features are obtained from a REST map service (which is an asynchronous request) I cannot figure out when to make this assignment since I don't know exactly when the graphics have all been added to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 19:43:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/retrieve-attributes-of-a-feature-when-clicked/m-p/667253#M62312</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2012-05-22T19:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve attributes of a feature when clicked</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/retrieve-attributes-of-a-feature-when-clicked/m-p/667254#M62313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I want to save the attributes of the feature I just clicked moments before. How do I know what feature I just clicked?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are probably a bunch of ways you could approach this - here is one suggested method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;dojo.connect(featureLayer, "onClick", function(evt) { &amp;nbsp; console.log(evt.graphic.attributes); });&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 20:53:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/retrieve-attributes-of-a-feature-when-clicked/m-p/667254#M62313</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2012-05-22T20:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve attributes of a feature when clicked</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/retrieve-attributes-of-a-feature-when-clicked/m-p/667255#M62314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There are probably a bunch of ways you could approach this - here is one suggested method:&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes this method will work for what I want to do..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And I don't know how I missed this in the API documentation. I remember seeing the setAttributes method and thinking "why isn't there a getAttributes too? That would be useful". Somehow I missed it in the properties..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I blame influenza&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Steve &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yohan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 10:58:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/retrieve-attributes-of-a-feature-when-clicked/m-p/667255#M62314</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2012-05-24T10:58:52Z</dc:date>
    </item>
  </channel>
</rss>

