source: trunk/grails-app/domain/dbnp/studycapturing/TemplateField.groovy @ 290

Last change on this file since 290 was 290, checked in by keesvb, 13 years ago

debugged EventDescription?.save, added comment field for template fields, add code comments to setFieldValue, added missing events to PPSH demo in BootStrap?, cleaned up home menu, re-added searchable

  • Property svn:keywords set to Author Rev Date
File size: 886 bytes
Line 
1package dbnp.studycapturing
2
3/**
4 * This is the superclass for template fields. Normally, this class will not be instantiated.
5 *
6 * Revision information:
7 * $Rev: 290 $
8 * $Author: keesvb $
9 * $Date: 2010-03-22 10:38:25 +0000 (ma, 22 mrt 2010) $
10 */
11class TemplateField implements Serializable {
12        String name
13        TemplateFieldType type
14        String unit
15        String comment // help string for the user interface
16
17    static hasMany = [listEntries : TemplateFieldListItem] // to store the entries to choose from when the type is 'item from predefined list'
18
19        static constraints = {
20                name(unique: true)
21                unit(nullable: true, blank: true)
22                comment(nullable:true, blank: true)
23        }
24
25        static mapping = {
26                comment type: 'text'
27        }
28
29        String toString() {
30                return name
31        }
32
33        //TODO: make a convenience setter for a string array
34        /*def setListEntries(ArrayList entries) {
35                list=[]
36                entries.each {
37                        list.add(new TemplateFieldListItem(name: it))
38                }
39                this
40        }*/
41
42}
Note: See TracBrowser for help on using the repository browser.