<?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: PopupTemplate runtime context in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-runtime-context/m-p/654956#M61080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I'm able to do a watch on the view.popup.visible property.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;When it becomes true, I set some values from the popup to a global variable.&amp;nbsp; I then can call a global method from within the popup markup.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have a global reference to the mapView instance.&amp;nbsp; If I modify some of the view's properties, I can then trigger their respective watch functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder which properties on the view would be appropriate to use as a proxy to communicate these user invoked custom actions from within the popup?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jan 2018 16:33:49 GMT</pubDate>
    <dc:creator>yangwen</dc:creator>
    <dc:date>2018-01-16T16:33:49Z</dc:date>
    <item>
      <title>PopupTemplate runtime context</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-runtime-context/m-p/654954#M61078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Short summary: I have a requirement where a popup has custom markup and actions bound to the markup that trigger various logic outside of the arcGis instance context.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Surely we can have container app supply the custom markup for a given popup. Within the popup markup, there needs the ability to listen to onclick actions within the markup.&amp;nbsp; Then that onclick needs to call a function with a specific context.&amp;nbsp; Am I stuck with the global context for popups?&amp;nbsp; I saw some example of popups calling functions defined in the local scope, via Arcade Expression.&amp;nbsp; There is no mentioning of managing contexts though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Long Details: I'm creating a map module that wraps the arcGIS map instance + API.&amp;nbsp; I need to allow container app to specify a collection of "actions" it wants the popup to display.&amp;nbsp; These actions will be bound to some HTML elements via custom popuptemplate markup.&amp;nbsp; From the an ArcGIS perspective, clicking on these action triggers should simply call the method prescribed, such as an action handler proxy method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;triggeredAction(actionId){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;emit.ActionTriggered(actionId)&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The container app would then listen to the action that was triggered from the popup and then execute logic accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The tricky part is to how from the context of the popup, resolve the triggeredAction method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to avoid using the actions construct of popup.&amp;nbsp; I think they are all rendered in a very fixed way.&amp;nbsp; I just want flexible markups and the ability to call some function with specific context.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jan 2018 23:22:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-runtime-context/m-p/654954#M61078</guid>
      <dc:creator>yangwen</dc:creator>
      <dc:date>2018-01-15T23:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate runtime context</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-runtime-context/m-p/654955#M61079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From looking at this sample, it looks like Arcade is resolving function identifier in the global context.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/sample-code/popuptemplate-function/index.html" title="https://developers.arcgis.com/javascript/latest/sample-code/popuptemplate-function/index.html"&gt;PopupTemplate - use functions to set content | ArcGIS API for JavaScript 4.6&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2018 16:13:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-runtime-context/m-p/654955#M61079</guid>
      <dc:creator>yangwen</dc:creator>
      <dc:date>2018-01-16T16:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate runtime context</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-runtime-context/m-p/654956#M61080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I'm able to do a watch on the view.popup.visible property.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;When it becomes true, I set some values from the popup to a global variable.&amp;nbsp; I then can call a global method from within the popup markup.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have a global reference to the mapView instance.&amp;nbsp; If I modify some of the view's properties, I can then trigger their respective watch functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder which properties on the view would be appropriate to use as a proxy to communicate these user invoked custom actions from within the popup?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2018 16:33:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-runtime-context/m-p/654956#M61080</guid>
      <dc:creator>yangwen</dc:creator>
      <dc:date>2018-01-16T16:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: PopupTemplate runtime context</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-runtime-context/m-p/654957#M61081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yang,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;The popup widget as an emit method that I would look at for your use.&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#emit" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#emit"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#emit&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jan 2018 14:06:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popuptemplate-runtime-context/m-p/654957#M61081</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-01-17T14:06:48Z</dc:date>
    </item>
  </channel>
</rss>

