<?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: Accessing title of default popup created for a SceneView in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-title-of-default-popup-created-for-a/m-p/1131210#M75813</link>
    <description>&lt;P&gt;Sounds like good old &lt;A href="https://en.wikipedia.org/wiki/Uncertainty_principle#Heisenberg's_microscope" target="_self"&gt;Heisenberg&lt;/A&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; But I think the log values you are witnessing are because they are evaluated during the click event. Without having the full source code, I assume when the click event fires, the view is still determining what feature to show in the popup or maybe still fetching title and other attributes from the server.&lt;/P&gt;&lt;P&gt;What works better is watching a specific property for changes:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.popup.watch("title", () =&amp;gt; {
  console.log(view.popup.title);
});&lt;/LI-CODE&gt;&lt;P&gt;Or using the &lt;A href="https://developer.chrome.com/docs/devtools/open/" target="_self"&gt;developer console&lt;/A&gt; to inspect the values directly when you see the popup is fully loaded. If "view" is not a global variable, this is one way to access it through the developer console (assuming you consume the API as an AMD module):&lt;/P&gt;&lt;LI-CODE lang="c"&gt;view = require("esri/views/View").views.getItemAt(0);
console.log(view.popup.title);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jan 2022 15:24:55 GMT</pubDate>
    <dc:creator>ArnoFiva</dc:creator>
    <dc:date>2022-01-06T15:24:55Z</dc:date>
    <item>
      <title>Accessing title of default popup created for a SceneView</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-title-of-default-popup-created-for-a/m-p/1131199#M75812</link>
      <description>&lt;P&gt;Is there a good way to access the properties of the default popup object created for a SceneView? (as in&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#popup" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#popup&lt;/A&gt;)&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;view.on("click", function (event) {&lt;BR /&gt;    console&lt;/SPAN&gt;.&lt;SPAN class=""&gt;log&lt;/SPAN&gt;(view.&lt;SPAN class=""&gt;popup&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;    console&lt;/SPAN&gt;.&lt;SPAN class=""&gt;log&lt;/SPAN&gt;(view.&lt;SPAN class=""&gt;popup&lt;/SPAN&gt;.&lt;SPAN class=""&gt;id&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;    console&lt;/SPAN&gt;.&lt;SPAN class=""&gt;log&lt;/SPAN&gt;(view.&lt;SPAN class=""&gt;popup&lt;/SPAN&gt;.&lt;SPAN class=""&gt;title&lt;/SPAN&gt;);&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;By logging view.popup to the console (using the lines of code shown above) I can see that the properties exist because the below lines are logged to the console (part of the output from Line 2).&lt;/P&gt;&lt;P&gt;id: "17e2bf83e50-widget-1"&lt;/P&gt;&lt;P&gt;title: "k0"&lt;/P&gt;&lt;P&gt;I then log just the id property (Line 3) and it prints just the id property. However, if I try to log view.popup.title (Line 4), it logs 'null' to the console. Anything else I try to print out using console.log prints the same value found within view.popup. I originally thought I was missing something about how things work in JavaScript but after a query on stackoverflow it seems like maybe it has to do with how view.popup is constructed? Maybe that view.popup.title is made later in the code and doesn't technically exist at that moment when I'm trying to log it?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 14:45:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-title-of-default-popup-created-for-a/m-p/1131199#M75812</guid>
      <dc:creator>AnnaPearson</dc:creator>
      <dc:date>2022-01-06T14:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing title of default popup created for a SceneView</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-title-of-default-popup-created-for-a/m-p/1131210#M75813</link>
      <description>&lt;P&gt;Sounds like good old &lt;A href="https://en.wikipedia.org/wiki/Uncertainty_principle#Heisenberg's_microscope" target="_self"&gt;Heisenberg&lt;/A&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; But I think the log values you are witnessing are because they are evaluated during the click event. Without having the full source code, I assume when the click event fires, the view is still determining what feature to show in the popup or maybe still fetching title and other attributes from the server.&lt;/P&gt;&lt;P&gt;What works better is watching a specific property for changes:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.popup.watch("title", () =&amp;gt; {
  console.log(view.popup.title);
});&lt;/LI-CODE&gt;&lt;P&gt;Or using the &lt;A href="https://developer.chrome.com/docs/devtools/open/" target="_self"&gt;developer console&lt;/A&gt; to inspect the values directly when you see the popup is fully loaded. If "view" is not a global variable, this is one way to access it through the developer console (assuming you consume the API as an AMD module):&lt;/P&gt;&lt;LI-CODE lang="c"&gt;view = require("esri/views/View").views.getItemAt(0);
console.log(view.popup.title);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 15:24:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-title-of-default-popup-created-for-a/m-p/1131210#M75813</guid>
      <dc:creator>ArnoFiva</dc:creator>
      <dc:date>2022-01-06T15:24:55Z</dc:date>
    </item>
  </channel>
</rss>

