                       type: 'text',
                       className: 'form-control'
                       id: "input-#{name}"
+                      ref: name
                       placeholder: 'Email or username'
                       name: name
                       value: that.getValue(name)
-                      onChange: that.handleChange
+                      onChange: that.updateCursorFromForm
                     }
                     if that.hasSuccess(name)
                       # TODO put this into its own component

) ->
  React.createClass
    mixins: [Cursors]
    handleChange: (event) ->
      delta = {}
      delta[event.target.name] = event.target.value
      command = {page: {data: {$merge: delta}}}
      # here we simulate the state changes
      updated = React.addons.update this.state, command
      errors = validateLogin updated.page.data
      console.log 'errors', errors
      this.update
        page:
          data: {$merge: delta}
          errors: {$set: errors}

    handleClick: (event) ->
      event.preventDefault()

      console.log 'ComponentLogin', 'render', 'this.state', this.state
      reactKup (k) ->
        k.div {className: 'ComponentLogin'}, ->
          k.build ComponentNavigation
          k.div {className: 'container'}, ->
            k.div {className: 'row'}, ->
