Hi all and Merry Christmas,
I created a very simple widget that clears the map's graphics layer. It only opens a jimu/dijits/Message which ask if you want to clear the features and two buttons, OK and CANCEL. The message dijit is created in the onOpen method and it is closed either when you click OK or CANCEL.
The weird thing is that when you start the app and click the widget button the first time, it opens two messages popups. This is because the onOpen method is called twice. The sequence is as follows:
postCreate - startup - onOpen - onClose - onOpen