   updateForm: (event, json) =>
     if @autoAction
       @form = $(json.template).replaceAll(@form)
+      if @containerIsForm
+        @container = @form
+        @reBind()
       @initForm()
     @form.trigger('jsonForm:updated')
 
   cancelForm:  =>
-    @container.remove()
+    @container.remove()
class CoffeeMiddleware.Component.JsonForm extends CoffeeMiddleware.System.Base
  constructor: (@container, @autoAction = true) ->
    super(@container)
    if @container.is 'form'
      @form = @container
    else
      @form = ($ 'form', @container)


          window.top.location = json.redirect
      else if json.template
        @form = $(json.template).replaceAll(@form)
        if @containerIsForm
          @container = @form
          @reBind()
        @initForm()
        @form.trigger('jsonForm:completed')
    else
