Grails Scaffolding Plugin
  1. Grails Scaffolding Plugin
  2. GPSCAFFOLD-36

Improve scaffolding to bind Helper class to execute common code (instead of limited renderEditor.template)

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Patch Submitted:
      Yes

      Description

      The current Scaffolding generator binds the renderEditor.template when generating views.
      This template is called from the create and edit gsp's.

      This functionality is limited to share common code for editors and it's not possible to have other common code in the generation process.

      In the XTemplates plugin I had solved this limitiion by binding a Helper.groovy class instead of the renderEditor.template in both the generateView and generateController process.
      This makes it's easy to have common code to be called when generating views and controller.

      I've attached a small patch for this.
      New file: Helper.groovy
      Changed files: create.gsp and edit.gsp
      Obsolete file: renderEditor.template

      I've tested it with both static and dynamic scaffolding in dev and war mode

        Issue Links

          Activity

          Hide
          Graeme Rocher added a comment -

          Hmm, ok but Helper.groovy currently does not reflect the same functionality as renderEditor.template in the 1.1 SVN branch (it is missing many-to-many handling etc.)

          Show
          Graeme Rocher added a comment - Hmm, ok but Helper.groovy currently does not reflect the same functionality as renderEditor.template in the 1.1 SVN branch (it is missing many-to-many handling etc.)
          Hide
          Marcel Overdijk added a comment -

          Yes I grabbed the latest from svn before you committed those changes today

          If you like the idea I can update the patch.

          Show
          Marcel Overdijk added a comment - Yes I grabbed the latest from svn before you committed those changes today If you like the idea I can update the patch.

            People

            • Assignee:
              Unassigned
              Reporter:
              Marcel Overdijk
            • Votes:
              3 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: