Ignore:
Timestamp:
Mar 5, 2010, 3:21:52 PM (9 years ago)
Author:
duh
Message:

Refectored version of the wizard

  • initial template page has been removed, now is a generic 'start' page where one (in the future) may create a new study, or load and modify an already stored study
  • study page incorporates study template select element, but does not yet incorporate the study template fields
  • subjects page now allows creation of subjects based on a template. This change also implied the study page altogether had to change into a seperate table entity. Now the the page lists as many tables as unique templates have been selected. These tables contain all subjects that were added using that particular template. NOTE: data is not stored yet, due to the fact that templateEntity does not work properly yey (key/value pairs need to be set correctly when calling the setTemplate method)
  • the JavaScript? now handles multiple tables in a page as well, and automatically initializes any underlying slider div if that is required
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateEntity.groovy

    r236 r238  
    44import org.codehaus.groovy.runtime.NullObject
    55
    6 class TemplateEntity {
     6/**
     7 * TemplateEntity Domain Class
     8 *
     9 * Revision information:
     10 * $Rev$
     11 * $Author$
     12 * $Date$
     13 */
     14class TemplateEntity implements Serializable {
    715
    816        Template template
     
    2937
    3038        static constraints = {
    31                 template(nullable: true)
     39                template(nullable: true, blank: true)
    3240
    3341        }
     
    8391                }
    8492                else {
    85                         if (templateStringFields.containsKey(fieldName) && value.class == String) {
     93                        if (templateStringFields && templateStringFields.containsKey(fieldName) && value.class == String) {
    8694                                this.templateStringFields[fieldName] = value
    8795                        }
    88                         if (templateStringListFields.containsKey(fieldName) && value.class == TemplateFieldListItem) {
     96                        if (templateStringFields && templateStringListFields.containsKey(fieldName) && value.class == TemplateFieldListItem) {
    8997                                // TODO: check if item really belongs to the list under fieldName
    9098                                this.templateStringListFields[fieldName] = value
     
    93101                                this.templateTextFields[fieldName] = value
    94102                        }
    95                         else if (templateIntegerFields.containsKey(fieldName) && value.class == Integer) {
     103                        else if (templateIntegerFields && templateIntegerFields.containsKey(fieldName) && value.class == Integer) {
    96104                                this.templateIntegerFields[fieldName] = value
    97105                        }
    98                         else if (templateFloatFields.containsKey(fieldName) && value.class == Float) {
     106                        else if (templateFloatFields && templateFloatFields.containsKey(fieldName) && value.class == Float) {
    99107                                this.templateFloatFields[fieldName] = value
    100108                        }
    101                         else if (templateDoubleFields.containsKey(fieldName) && value.class == Double) {
     109                        else if (templateDoubleFields && templateDoubleFields.containsKey(fieldName) && value.class == Double) {
    102110                                this.templateDoubleFields[fieldName] = value
    103111                        }
    104                         else if (templateDateFields.containsKey(fieldName) && value.class == Date) {
     112                        else if (templateDateFields && templateDateFields.containsKey(fieldName) && value.class == Date) {
    105113                                this.templateDateFields[fieldName] = value
    106114                        }
    107                         else if (templateTermFields.containsKey(fieldName) && value.class == Term) {
     115                        else if (templateTermFields && templateTermFields.containsKey(fieldName) && value.class == Term) {
    108116                                this.templateTermFields[fieldName] = value
    109117                        }
     
    129137                // TODO: initialize all template fields with the necessary keys and null values
    130138
    131                 println "Setting template " + newTemplate
     139                //println "Setting template " + newTemplate
    132140                if (template != null) {
    133141
Note: See TracChangeset for help on using the changeset viewer.