Index: trunk/grails-app/controllers/AssignedGroupDetailedController.groovy
===================================================================
--- trunk/grails-app/controllers/AssignedGroupDetailedController.groovy	(revision 248)
+++ trunk/grails-app/controllers/AssignedGroupDetailedController.groovy	(revision 254)
@@ -12,29 +12,4 @@
     // the delete, save and update actions only accept POST requests
     static allowedMethods = [delete:'POST', save:'POST', update:'POST']
-
-    def list = {
-            def result = assignedGroupService.list(params)
-            if(!result.error) {
-                return [ assignedGroupInstanceList: result.assignedGroupInstanceList,
-                                assignedGroupInstanceTotal: result.assignedGroupInstanceTotal ]
-            }
-
-            flash.message = g.message(code: result.error.code, args: result.error.args)
-            redirect( controller: "appCore", action: "start" )
-    }
-
-    def show = {
-        def result = assignedGroupService.show(params)
-
-        if(!result.error)
-            return [ assignedGroupInstance: result.assignedGroupInstance ]
-
-        flash.message = g.message(code: result.error.code, args: result.error.args)
-
-        if(params.task?.id)
-            redirect(controller:"taskDetailed", action:"show", id: params.task.id)
-
-        redirect(controller:"taskDetailed", action:"search")
-    }
 
     def delete = {
@@ -60,6 +35,9 @@
         def result = assignedGroupService.edit(params)
 
-        if(!result.error)
-            return [ assignedGroupInstance : result.assignedGroupInstance ]
+        if(!result.error) {
+            return [assignedGroupInstance: result.assignedGroupInstance,
+                            personGroup: result.personGroup,
+                            personsInGroup: result.personsInGroup]
+        }
 
         flash.message = g.message(code: result.error.code, args: result.error.args)
@@ -74,5 +52,5 @@
         if(!result.error) {
             flash.message = g.message(code: "default.update.success", args: ["AssignedGroup", params.id])
-            redirect(action:show, id: params.id)
+            redirect(controller:"taskDetailed", action:"show", id: result.assignedGroupInstance.task.id)
             return
         }
@@ -84,5 +62,13 @@
         }
 
-        render(view:'edit', model:[assignedGroupInstance: result.assignedGroupInstance.attach()])
+        if(result.error.code == "personGroup.not.found") {
+            flash.message = g.message(code: result.error.code, args: result.error.args)
+            redirect(action:"edit", id: params.id)
+            return
+        }
+
+        render(view:'edit', model:[assignedGroupInstance: result.assignedGroupInstance.attach(),
+                                                personGroup: result.personGroup.attach(),
+                                                personsInGroup: result.personsInGroup])
     }
 
@@ -90,6 +76,9 @@
         def result = assignedGroupService.create(params)
 
-        if(!result.error)
-            return [assignedGroupInstance: result.assignedGroupInstance]
+        if(!result.error) {
+            return [assignedGroupInstance: result.assignedGroupInstance,
+                            personGroup: result.personGroup,
+                            personsInGroup: result.personsInGroup]
+        }
 
         if(result.error.code == "assignedGroup.task.not.found") {
@@ -112,5 +101,28 @@
         }
 
-        render(view:'edit', model:[assignedGroupInstance: result.assignedGroupInstance])
+        if(result.error.code == "personGroup.not.found") {
+            flash.message = g.message(code: result.error.code, args: result.error.args)
+            redirect(action:"create", params:["task.id": params.task?.id])
+            return
+        }
+
+        render(view:'create', model:[assignedGroupInstance: result.assignedGroupInstance,
+                                                personGroup: result.personGroup.attach(),
+                                                personsInGroup: result.personsInGroup])
+    }
+
+    def personsInGroup = {
+        def result = assignedGroupService.personsInGroup(params)
+
+        if(!result.error) {
+            render ( template:"personsInGroup",
+                            model: [personGroup: result.personGroup, personsInGroup: result.personsInGroup] )
+            return
+        }
+
+        render {
+            div(id:"personsInGroup", g.message(code: result.error.code, args: result.error.args) )
+        }
+
     }
 
