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.
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. Then that onclick needs to call a function with a specific context. Am I stuck with the global context for popups? I saw some example of popups calling functions defined in the local scope, via Arcade Expression. There is no mentioning of managing contexts though.
Long Details: I'm creating a map module that wraps the arcGIS map instance + API. I need to allow container app to specify a collection of "actions" it wants the popup to display. These actions will be bound to some HTML elements via custom popuptemplate markup. From the an ArcGIS perspective, clicking on these action triggers should simply call the method prescribed, such as an action handler proxy method:
The container app would then listen to the action that was triggered from the popup and then execute logic accordingly.
The tricky part is to how from the context of the popup, resolve the triggeredAction method.
I want to avoid using the actions construct of popup. I think they are all rendered in a very fixed way. I just want flexible markups and the ability to call some function with specific context.