There are some dialog boxes that take a callback as argument, but only call it on success, not on cancel. This prevents actions such as setting a correct focus when the dialog is closed with "cancel".
Some helpers that have this problem :
Ametys.helper.FileUpload
Ametys.cms.uihelper.SelectContentBySearch
Ametys.web.helper.ChoosePage