Is it possible to have a code/function that executes before a custom on-panel widget is opened?
For example I want it to hook a button in the Map's popup that will then call the widget if it's not open.
A off-panel widget or external configuration wouldn't be ideal, I need this to be inside the Widget's scope and keep it modular.
Samuel,
No any code inside the widget code base will not be executed until the widget itself is added.
Following my question :
"For example I want it to hook a button in the Map's popup that will then call the widget if it's not open."
How would you design a solution for this? Like how the edit widget adds a "edit" button in the popup.
Samuel,
The edit action is registered in the popup by the FeatureActionManager.js because it is in the Edit widgets manifest.json. The action will be added to the popup and the WidgetManager will launch the edit widget because it listens for the builder/actionTrigger topic and if the widget is not already opened it will be loaded.