Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Environment:Windows XP
Java JDK 1.6.0_04
Grails 1.0.1
-
Testcase included:yes
Description
When using Dynamic Scaffolding (def scaffold = true;), the Controller scaffolding template found in src/templates/scaffolding/Controller.groovy is not used. This template IS used when performing grails generate-controller. And the View templates in this folder ARE used with Dynamic Scaffolding. This prevents mass customization of Controllers through Dynamic Scaffolding. It also breaks the expectations of the user; one works and one doesn't.
Attached an example project, where an attempt is made to add a 'Cancel' action and selection to scaffolded Controllers and Views. Files of note:
| grails-app/controllers/SomeObjectController.groovy | Dynamic Scaffold Controller for SomeObject Domain Class |
| src/templates/scaffolding/Controller.groovy | Expected template for Dynamic Scaffold Controllers; added cancel action |
| src/templates/scaffolding/create.gsp | Added a Cancel button |
| src/templates/scaffolding/edit.gsp | Added a Cancel button |
Running this project, both the Create and Edit views include the Cancel button added to the create.gsp and edit.gsp templates. But attempting to select either Cancel button results in the following Runtime Exception:
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.UnknownControllerException: No controller found for URI [/someObject/cancel]!
The included test (grails test-app SomeObjectController) also fails. Both functionalities work if the Controller and Views are generated (grails generate-all SomeObject). This confirms that the cancel action added to the Controller template is not being included in the Dynamic Scaffolding, as expected.
-
Hide
- CancelScaffold.zip
- 28/Mar/08 9:59 AM
- 196 kB
- Justin Michalczak
-
- CancelScaffold/.classpath 6 kB
- CancelScaffold/.project 0.5 kB
- CancelScaffold/application.properties 0.1 kB
- CancelScaffold/build.xml 1 kB
- CancelScaffold/CancelScaffold.launch 2 kB
- CancelScaffold/CancelScaffold.tmproj 2 kB
- CancelScaffold/.../BootStrap.groovy 0.1 kB
- CancelScaffold/grails-app/.../Config.groovy 3 kB
- CancelScaffold/.../DataSource.groovy 0.6 kB
- CancelScaffold/.../resources.groovy 0.0 kB
- CancelScaffold/.../UrlMappings.groovy 0.2 kB
- CancelScaffold/.../SomeObjectController.groovy 0.1 kB
- CancelScaffold/.../SomeObject.groovy 0.1 kB
- CancelScaffold/.../messages.properties 2 kB
- CancelScaffold/.../messages_de.properties 3 kB
- CancelScaffold/.../messages_es.properties 3 kB
- CancelScaffold/.../messages_fr.properties 2 kB
- CancelScaffold/.../messages_it.properties 2 kB
- CancelScaffold/.../messages_ja.properties 2 kB
- CancelScaffold/.../messages_nl.properties 3 kB
- CancelScaffold/.../messages_ru.properties 4 kB
- CancelScaffold/.../messages_th.properties 5 kB
- CancelScaffold/.../messages_zh_CN.properties 2 kB
- CancelScaffold/grails-app/.../error.gsp 1 kB
- CancelScaffold/grails-app/.../main.gsp 0.7 kB
- CancelScaffold/src/.../Controller.groovy 0.1 kB
- CancelScaffold/src/.../DomainClass.groovy 0.0 kB
- CancelScaffold/src/.../Script.groovy 0.3 kB
- CancelScaffold/src/.../Service.groovy 0.1 kB
- CancelScaffold/src/.../TagLib.groovy 0.0 kB
Issue Links
- relates to
-
GPSCAFFOLD-20
View Template Files - Dynamic Identification
-
Activity
I totally agree. Good to see the scaffolding pluggability and extensibility is a candidate for 1.1.
This morning I already started a thread about it on the dev mailing list.
Reduced priority of non critical issues which have current workarounds
Hope this issue won't be forgotten due to lowering the priority.
I think it's still annoying that - when changing the templates - the generate commands behave differently then the dynamic scaffold property.
I assume the work around is simply the regeneration of controllers. I too hope this won't be forgotten with the lowering of priorities. Is a fix likely in the 1.1 release.
Yes the wourkaround is to use the static scaffolding using the generate-* commands.
6 voters already for this issue so I have the feeling a lot of uses think this feature isimportant.
I think that this is a must. Up until running into this little twig all my Grails research was going smooth, but this is confusing to most users since when you generate templates you can update other dynamic scaffolding options (via the views).
+1 to make this into the 1.1 since I can't vote again
This is a large issue and I prefer to not introduce such a big change in a point release