<?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 Call Default Popup from ActionToggle? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/call-default-popup-from-actiontoggle/m-p/1137154#M76090</link>
    <description>&lt;P&gt;Is there a way to &lt;STRONG&gt;programmatically display a popup as if the location marker (graphic) was clicked&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;I want to use an &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html" target="_self"&gt;ActionToggle&lt;/A&gt; to display and/or hide some additional content in the popup. Everything is good except for me knowing what to call to redisplay the default incarnation of the popup.&lt;/P&gt;&lt;P&gt;As an example, suppose I am mapping ice cream shops and the default popup displays a name, address, and phone number. I define the popup template like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const store_popup = {
    title: "{name}",
    content: "&amp;lt;p&amp;gt;{address}&amp;lt;/p&amp;gt;" + "&amp;lt;p&amp;gt;{phone}&amp;lt;/p&amp;gt; &amp;lt;/div&amp;gt;",
    actions: [flavorsToggle]
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the popup, I have an ActionToggle to display specialty flavors of ice cream available at the shop (in an HTML table). I might have one function to display the extra information using &lt;FONT face="andale mono,times"&gt;view.popup.content&lt;/FONT&gt;:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;showFlavors() {
    return view.popup.content =
        "&amp;lt;div class='esri-feature-content'&amp;gt;" 							
        + "&amp;lt;p&amp;gt;" + view.popup.selectedFeature.attributes.address 
        + "&amp;lt;p&amp;gt;" + view.popup.selectedFeature.attributes.phone
        + "&amp;lt;table&amp;gt;" 
        + view.popup.selectedFeature.attributes.flavors
        + "&amp;lt;/table&amp;gt;"
        + "&amp;lt;/div&amp;gt;";
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I write the code for the companion &lt;FONT face="andale mono,times"&gt;hideFlavors() &lt;/FONT&gt;function, I want to call the popup in its default form -- as it is defined by the popup template. Is there a way to do that?&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jan 2022 22:19:20 GMT</pubDate>
    <dc:creator>IfThenTim</dc:creator>
    <dc:date>2022-01-25T22:19:20Z</dc:date>
    <item>
      <title>Call Default Popup from ActionToggle?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/call-default-popup-from-actiontoggle/m-p/1137154#M76090</link>
      <description>&lt;P&gt;Is there a way to &lt;STRONG&gt;programmatically display a popup as if the location marker (graphic) was clicked&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;I want to use an &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html" target="_self"&gt;ActionToggle&lt;/A&gt; to display and/or hide some additional content in the popup. Everything is good except for me knowing what to call to redisplay the default incarnation of the popup.&lt;/P&gt;&lt;P&gt;As an example, suppose I am mapping ice cream shops and the default popup displays a name, address, and phone number. I define the popup template like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const store_popup = {
    title: "{name}",
    content: "&amp;lt;p&amp;gt;{address}&amp;lt;/p&amp;gt;" + "&amp;lt;p&amp;gt;{phone}&amp;lt;/p&amp;gt; &amp;lt;/div&amp;gt;",
    actions: [flavorsToggle]
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the popup, I have an ActionToggle to display specialty flavors of ice cream available at the shop (in an HTML table). I might have one function to display the extra information using &lt;FONT face="andale mono,times"&gt;view.popup.content&lt;/FONT&gt;:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;showFlavors() {
    return view.popup.content =
        "&amp;lt;div class='esri-feature-content'&amp;gt;" 							
        + "&amp;lt;p&amp;gt;" + view.popup.selectedFeature.attributes.address 
        + "&amp;lt;p&amp;gt;" + view.popup.selectedFeature.attributes.phone
        + "&amp;lt;table&amp;gt;" 
        + view.popup.selectedFeature.attributes.flavors
        + "&amp;lt;/table&amp;gt;"
        + "&amp;lt;/div&amp;gt;";
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I write the code for the companion &lt;FONT face="andale mono,times"&gt;hideFlavors() &lt;/FONT&gt;function, I want to call the popup in its default form -- as it is defined by the popup template. Is there a way to do that?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 22:19:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/call-default-popup-from-actiontoggle/m-p/1137154#M76090</guid>
      <dc:creator>IfThenTim</dc:creator>
      <dc:date>2022-01-25T22:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Call Default Popup from ActionToggle?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/call-default-popup-from-actiontoggle/m-p/1137158#M76091</link>
      <description>&lt;LI-CODE lang="javascript"&gt;view.popup.open({
     location: somePointObject,  // location 
     fetchFeatures: true // display the content for the selected feature if a popupTemplate is defined.
   });&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 25 Jan 2022 22:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/call-default-popup-from-actiontoggle/m-p/1137158#M76091</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2022-01-25T22:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Call Default Popup from ActionToggle?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/call-default-popup-from-actiontoggle/m-p/1137182#M76092</link>
      <description>&lt;P&gt;Thanks for the reply!&lt;/P&gt;&lt;P&gt;Being new to almost everything having to do with this, it's not obvious to me how &lt;FONT face="andale mono,times"&gt;somePointObject&lt;/FONT&gt; gets set to the location value of the last graphic clicked. Can you elaborate on how that might happen or refer me to an example or relevant doc?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 23:12:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/call-default-popup-from-actiontoggle/m-p/1137182#M76092</guid>
      <dc:creator>IfThenTim</dc:creator>
      <dc:date>2022-01-25T23:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Call Default Popup from ActionToggle?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/call-default-popup-from-actiontoggle/m-p/1137351#M76098</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/535242"&gt;@IfThenTim&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without seeing your code it is a little hard to speculate. The view.popup has a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features" target="_self"&gt;features&lt;/A&gt; property that is an array of graphics. You could use this then:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.popup.open({
  features: view.popup.features,  // array of graphics
  fetchFeatures: true  //fetch the content of this feature and display it
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 13:33:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/call-default-popup-from-actiontoggle/m-p/1137351#M76098</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2022-01-26T13:33:33Z</dc:date>
    </item>
  </channel>
</rss>

