model

Purpose

Property that points to the model associated with this MVC group.

Examples

Controller:

class SampleController {
    def model
    def copyText = { evt = null ->
        model.output = model.input
    }
}

View:

application(title: 'Sample', pack:true, locationByPlatform:true,
  iconImage: imageIcon('/griffon-icon-48x48.png').image,
  iconImages: [imageIcon('/griffon-icon-48x48.png').image,
               imageIcon('/griffon-icon-32x32.png').image,
               imageIcon('/griffon-icon-16x16.png').image]) {
   gridLayout(cols: 1, rows, 2)
   textField(text: bind(target: model, targetProperty: 'input'))
   textField(text: bind{ model.output}, editable: false)
}

Description

Models are responsible for holding data that can be used from both Views and Controllers.