We would like our custom widget to behave like this:
1) User clicks the widget icon to enable the widget. No widget popup window is shown.
2) After the user clicks on the map, the widget window is opened.
3) A js function is called and we can fetch the clicked coordinates.
Something like:
map.on("click", function (evt) {
var x = evt.mapPoint.x;
var y = evt.mapPoint.y;
})
How do we stop the widget window of showing after clicking the widget icon?
Maybe a workable solution would be to minimize the widget using minimizeWidget(widget) and then when you are ready call normalizeWidget(widget) to put it back to the normal size.
https://developers.arcgis.com/web-appbuilder/api-reference/widgetmanager.htm