     @loadItems()
 
     list.on "DeleteDatabaseSubmitted", (listItem)=> @deleteDatabase listItem
-    list.on "UpdateDatabaseSubmitted", (listItem, formdata)=> @updateDatabase listItem, formdata
+    list.on "UpdateDatabaseSubmitted", (listItem, password)=>
+      @updateDatabase listItem, password
+
+    list.on "HideAllWidgets", =>
+      for item in @itemsOrdered
+        item.deleteWidget?.destroy?()
+        item.editWidget?.destroy?()
+        delete item.deleteWidget
+        delete item.editWidget
+
+    @on "DatabaseUpdated", (listItem)=>
+      listItem.changePassword.hideLoader()
+      @emit "ListUpdated"
+      list.emit "HideAllWidgets"
 
     @on "DatabaseDeleted", (listItem)=>
       list.removeItem listItem
       @emit "ListUpdated"
-    # @on "DatabaseUpdated", (listItem)=>
 
   loadItems:(callback)->
     @removeAllItems()

      {{> @cancelButton}} {{> @deleteButton}}
    """

class NewDBCreatedWidget extends KDView

  constructor:(options = {}, data)->

    options.cssClass = "modal-hint"
    options.partial  = """
      <h3>Your new #{data.dbType} database just created!</h3>
      <p><label>Host:</label> <i>#{data.dbHost}</i></p>
      <p><label>Name:</label> <i>#{data.dbName}</i></p>
      <p><label>User:</label> <i>#{data.dbUser}</i></p>

      method        : @commands[data.dbType].update
      withArgs      :
        dbUser      : data.dbUser
        newPassword : password
    , (err, response)=>
      if err
        @notify "An error occured, try again later!", "error"
      else
        @notify "Database updated!", "succes"
        @emit "DatabaseUpdated", listItem

  addDatabase:(formData, callback)->
    {dbType} = formData
