     __setupWidget: ->
       @template = new ns.Template(@settings, @element)
 
-      @template.addButton('cancel', t('buttons.cancel')).on('click', @__reset)
+      @template.addButton('cancel', t('buttons.cancel')).on 'click', =>
+        @__setObject(null)
+
       if @settings.clearable
-        @template.addButton('remove', t('buttons.remove')).on('click', @__reset)
+        @template.addButton('remove', t('buttons.remove')).on 'click', =>
+          @__setObject(null)
 
       # Create the dialog and widget buttons
       if @settings.tabs.length > 0

        if newFile
          @currentObject = newFile
          @__watchCurrentObject()

    __watchCurrentObject: ->
      object = @__currentFile()

      else
        info.uuid

    __reset: =>
      # low-level primitive. @__setObject(null) could be better.
      @currentObject?.cancel?()
      @currentObject = null
      @template.reset()
      @element.val('')

    __setObject: (newFile) =>
      unless newFile == @currentObject
