Index: trunk/grails-app/controllers/EntryDetailedController.groovy
===================================================================
--- trunk/grails-app/controllers/EntryDetailedController.groovy	(revision 838)
+++ trunk/grails-app/controllers/EntryDetailedController.groovy	(revision 859)
@@ -10,5 +10,5 @@
 
     // the delete, save and update actions only accept POST requests
-    static allowedMethods = [delete:'POST', save:'POST', update:'POST']
+    static allowedMethods = [delete:'POST', save:'POST', update:'POST', ajaxCreate:'POST', ajaxSave:'POST']
 
     def list = {
@@ -106,7 +106,6 @@
     def ajaxCreate = {
         if(!params.taskId || !params.entryTypeId) {
-            response.status = 403
             params.errorMessage = g.message(code: "entry.create.no.params.ajax")
-            render(template: "/shared/messages")
+            render(contentType:"text/json", status: 403, template: "/shared/messages")
             return
         }
@@ -115,7 +114,6 @@
 
         if(!taskInstance) {
-            response.status = 403
             params.errorMessage = g.message(code:"default.not.found", args:['Task',params.taskId])
-            render(template: "/shared/messages")
+            render(contentType:"text/json", status: 403, template: "/shared/messages")
             return
         }
@@ -123,7 +121,6 @@
         // Check for Complete task.
         if(taskInstance.taskStatus.id == 3) {
-            response.status = 403
             params.errorMessage = g.message(code:"task.operationNotPermittedOnCompleteTask")
-            render(template: "/shared/messages")
+            render(contentType:"text/json", status: 403, template: "/shared/messages")
             return
         }
@@ -133,6 +130,13 @@
         entryInstance.task = taskInstance
         entryInstance.entryType = EntryType.read(params.entryTypeId)
-        render(template: "create", model: ['entryInstance': entryInstance])
-    }
+        def model = ['entryInstance': entryInstance]
+
+        render(contentType:"text/json") {
+            updates = array {
+                element([ mode: 'replace', target:"$params.target", content: g.render(template: 'create', model:model) ])
+            }
+        }
+
+    } // ajaxCreate
 
     def ajaxSave = {
@@ -142,22 +146,25 @@
         if(!result.error) {
             def entryList = Entry.withCriteria {
-                                                                eq("entryType", result.entryInstance.entryType)
-                                                                task {
-                                                                    idEq(result.taskId)
-                                                                }
-                                                        }
-            render(template: "list", model: ['entryList': entryList])
-            return
-        }
-
-        if(result.error.code != "default.create.failure") {
-            response.status = 403
+                                            eq("entryType", result.entryInstance.entryType)
+                                            task {
+                                                idEq(result.taskId)
+                                            }
+                                    }
+
+            def model = ['entryList': entryList]
+
+            render(contentType:"text/json") {
+                updates = array {
+                    element([ mode: 'replace', target:"$params.target", content: g.render(template: 'list', model:model) ])
+                }
+            }
+            return
+        }
+
+        if(result.error.code != "default.create.failure")
             params.errorMessage = g.message(code: result.error.code)
-            render(template: "/shared/messages")
-            return
-        }
-
-        response.status = 403
-        render(template: "create", model: ['entryInstance': result.entryInstance])
+
+        def model = ['entryInstance': result.entryInstance]
+        render(contentType:"text/json", status: 403, template: "create", model: model)
     } // ajaxSave
 
