Dialog onClose callback

This fix adds the possibility to call a callback everytime the Dialog widget is closed.
Is it necessary to check the values here? They have been initialized before displaying the template