History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-2749
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Graeme Rocher
Reporter: Justin Michalczak
Votes: 4
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Grails

Scaffolding Controller template not used in Dynamic Scaffolding

Created: 28/Mar/08 09:59 AM   Updated: 29/May/08 04:51 AM
Component/s: Scaffolding
Affects Version/s: 1.0.1
Fix Version/s: 1.1

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive CancelScaffold.zip (196 kb)

Environment:
Windows XP
Java JDK 1.6.0_04
Grails 1.0.1
Issue Links:
Related
 

Testcase included: yes


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Graeme Rocher - 29/May/08 04:45 AM
This is a large issue and I prefer to not introduce such a big change in a point release

Marcel Overdijk - 29/May/08 04:50 AM
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.