<?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 map.infowindow.getselectedfeature() returning undefined and How to get the currently selected feature ? in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/map-infowindow-getselectedfeature-returning/m-p/130399#M3760</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I select a geometry on map, the method map.infoWindow.getSelectedFeature() always returns "undefined". This behaviour is not working code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map = new Map("mapDiv", {});&lt;/P&gt;&lt;P&gt;map.infoWindow.on("selection-change", function ()&lt;/P&gt;&lt;P&gt;{ var graphic = map.infoWindow.getSelectedFeature(); // graphics is always "undefined" }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to get the currently selected feature&amp;nbsp;?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 May 2017 14:17:00 GMT</pubDate>
    <dc:creator>esriuser2</dc:creator>
    <dc:date>2017-05-18T14:17:00Z</dc:date>
    <item>
      <title>map.infowindow.getselectedfeature() returning undefined and How to get the currently selected feature ?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/map-infowindow-getselectedfeature-returning/m-p/130399#M3760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I select a geometry on map, the method map.infoWindow.getSelectedFeature() always returns "undefined". This behaviour is not working code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map = new Map("mapDiv", {});&lt;/P&gt;&lt;P&gt;map.infoWindow.on("selection-change", function ()&lt;/P&gt;&lt;P&gt;{ var graphic = map.infoWindow.getSelectedFeature(); // graphics is always "undefined" }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to get the currently selected feature&amp;nbsp;?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2017 14:17:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/map-infowindow-getselectedfeature-returning/m-p/130399#M3760</guid>
      <dc:creator>esriuser2</dc:creator>
      <dc:date>2017-05-18T14:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: map.infowindow.getselectedfeature() returning undefined and How to get the currently selected feature ?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/map-infowindow-getselectedfeature-returning/m-p/130400#M3761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;esri user,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Because you are creating a new map and not trying to use the existing map you will never get a selection. You need to use the existing map object:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;infoWindow&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"selection-change"&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;&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; graphic &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;infoWindow&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getSelectedFeature&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="comment token"&gt;// graphics is always "undefined"&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:20:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/map-infowindow-getselectedfeature-returning/m-p/130400#M3761</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T07:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: map.infowindow.getselectedfeature() returning undefined and How to get the currently selected feature ?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/map-infowindow-getselectedfeature-returning/m-p/130401#M3762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you need to use lang.hitch here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;this.map.infoWindow.on("selection-change", lang.hitch(this, function (){
&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic = this.map.infoWindow.getSelectedFeature(); // graphics is always "undefined"
}));&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:20:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/map-infowindow-getselectedfeature-returning/m-p/130401#M3762</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T07:20:15Z</dc:date>
    </item>
  </channel>
</rss>

