 
   reset: ->
     @fields.forEach (x) ->
-      type = x.getAttribute("type")
-      x.value = "" if type in ["text","password"]
-      x.checked = false if type in ["checkbox"]
+      if x.getAttribute
+        type = x.getAttribute("type")
+      else
+        type = "text"
+      x.value = "" if type in ["password", "text"] #passwords and directory pickers
+      if type == "text" && x.setText #mini editors as text fields
+        x.setText("")
+
+      x.checked = false if type == "checkbox"
 
   setValues: (data) ->
     @reset()
     Object.keys(data).forEach (k) =>
       field = @fields.find (x) -> x.id == k
-      field?.value = data[k] if field?.getAttribute("type") in ["text","password","select"]
-      field?.checked = data[k] if field?.getAttribute("type") == "checkbox"
+      field?.value = data[k] if field?.getAttribute && field?.getAttribute("type") in ["password","select"]
+      field?.setText = data[k] if field? instanceof TextEditor
+      field?.checked = data[k] if field?.getAttribute && field?.getAttribute("type") == "checkbox"
 
   getValues: () ->
     values = {}
     @fields.forEach (x) ->
-      type = x.getAttribute("type")
+      if x.getAttribute
+        type = x.getAttribute("type")
+      else
+        type = "text"
       values[x.id] = x.value if type in ["text","password","select"]
       values[x.id] = (x.checked == true) if type == "checkbox"
+      values[x.id] = x.getText if x instanceof TextEditor
     # console.log values
     return values
 

      field.setAttribute "value", 0
      field.setAttribute "max", 100

    td.appendChild field
    # console.log "Created field", field, field.id
    return td


{TextEditor} = require 'atom'

class FormView extends HTMLElement

  initialize: () ->
