Griffon
  1. Griffon
  2. GRIFFON-466

Skip firing events when creating an MVC group instance

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.5-rc1
    • Fix Version/s: 0.9.5-rc2
    • Component/s: rt
    • Labels:
      None
    • Number of attachments :
      0

      Description

      From GRIFFON-463 : There are times when creating multiple MVC groups where there's no need to trigger MVC events for example, a custom MVCGroupManager can potentially disable the event router for a time, then enable it after the group has been constructed.

      This feature is generic enough to warrant inclusion in griffon core.
      Proposal: specify a special key in the group's config section that marks this group for no event firing, like this

      mvcGroups {
          // MVC Group for "foo"
          'foo' {
              model      = 'foo.FooModel'
              view       = 'foo.FooView'
              controller = 'foo.FooController'
              config {
                  events {
                      fire = false
                  }
              }
          }
      }
      

        Activity

        Hide
        Edo added a comment -

        Hmmm, IIRC the issue when including swing extending classes under JRE5 had an event in the stack trace.

        Wondering if disabling events while the group spawns could help...

        Show
        Edo added a comment - Hmmm, IIRC the issue when including swing extending classes under JRE5 had an event in the stack trace. Wondering if disabling events while the group spawns could help...
        Hide
        Andres Almiray added a comment -

        Might be related but I believe this is a class file issue, that is, the files were compiled using JDK1.6 which uses source/target levels as 1.6 by default.

        Show
        Andres Almiray added a comment - Might be related but I believe this is a class file issue, that is, the files were compiled using JDK1.6 which uses source/target levels as 1.6 by default.
        Hide
        Andres Almiray added a comment -

        Changed the flag to

        mvcGroups {
            // MVC Group for "foo"
            'foo' {
                model      = 'foo.FooModel'
                view       = 'foo.FooView'
                controller = 'foo.FooController'
                config {
                    events {
                        lifecycle = false
                    }
                }
            }
        }
        

        Only the following events will be disabled

        • InitializeMVCGroup
        • CreateMVCGroup
        • DestroyMVCGroup
        Show
        Andres Almiray added a comment - Changed the flag to mvcGroups { // MVC Group for "foo" 'foo' { model = 'foo.FooModel' view = 'foo.FooView' controller = 'foo.FooController' config { events { lifecycle = false } } } } Only the following events will be disabled InitializeMVCGroup CreateMVCGroup DestroyMVCGroup

          People

          • Assignee:
            Andres Almiray
            Reporter:
            Andres Almiray
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: