If you require some logic to run each time the widget appears on the page, add the beforeAppear()
function to the widget JavaScript’s return object:
beforeAppear: function(page) { // Code to run before showing the widget here. }
beforeAppear()
is run once any re-population of mapping data has occurred. This can be useful when a Web API call is required every time the widget is shown, or, some other functionality required every time the widget is shown.