How can i close a form from a widgets?

I have a data-view as popup, which is containing a widgets this widgets is doing some operation and finally calling a microflow. I want to close this data-view page from the widgets or from the microflow which is calling from the widgets. I tried to close this form from microflow, but it is not closing.
1 answers

You will need to specify a few things in your widget in order for the microflows it executes to respond to close form.

1) 'mendix.addon._Scriptable'.

2) run this in your postCreate: this.offerInterfaces(["close"]);

3) add this function in your widget: close : function() { this.disposeContent(); }

You can set your own instead of the disposeContent(), which will close the current form.

You also might need to add 'caller : this' to your execute microflow arguments if you don't already have it.