Ignore:
Timestamp:
Mar 9, 2010, 2:16:07 PM (14 years ago)
Author:
duh
Message:
  • date and datetimefields are now handled independent of naming but by field type (a rel='date' and rel='datetime' argument is added to the rendered input element)
  • client side error reporting did not work properly for select elements
  • dynamically inserted javascript confirmation warning in the DOM-anchors outside of the wizard (navigating away from the wizard without saving causes loss of data and work)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy

    r247 r250  
    343343                }
    344344
     345                // add 'rel' field to identity the datefield using javascript
     346                attrs.rel = 'date'
     347
    345348                // set some textfield values
    346349                attrs.maxlength = (attrs.maxlength) ? attrs.maxlength : 10
     
    367370                        attrs.value = String.format('%td/%<tm/%<tY %<tH:%<tM', attrs.value)
    368371                }
     372
     373                // add 'rel' field to identity the field using javascript
     374                attrs.rel = 'datetime'
    369375
    370376                attrs.addExampleElement = true
     
    581587                        out << '<div class="' + attrs.get('class') + '">'
    582588
    583                         switch (it.type) {
     589                        switch (it.type.toString()) {
     590                                case ['STRING', 'TEXT', 'INTEGER', 'FLOAT', 'DOUBLE']:
     591                                        out << textField(
     592                                                name: attrs.name + '_' + it.name,
     593                                                value: (intFields) ? intFields.get(it.name) : ''
     594                                        )
     595                                        break
    584596                                case 'STRINGLIST':
    585597                                        // render stringlist subjectfield
     
    593605                                                out << '<span class="warning">no values!!</span>'
    594606                                        }
    595                                         break;
    596                                 case 'INTEGER':
    597                                         // render integer subjectfield
    598                                         out << textField(
    599                                                 name: attrs.name + '_' + it.name,
    600                                                 value: (intFields) ? intFields.get(it.name) : ''
    601                                         )
    602                                         break;
    603                                 case 'FLOAT':
    604                                         // render float subjectfield
    605                                         out << textField(
    606                                                 name: attrs.name + '_' + it.name,
    607                                                 value: (floatFields) ? floatFields.get(it.name) : ''
    608                                         )
    609                                         break;
     607                                        break
    610608                                default:
    611609                                        // unsupported field type
     
    632630                        // render template fields
    633631                        template.fields.each() {
    634                                 switch (it.type) {
     632                                switch (it.type.toString()) {
     633                                        case ['STRING', 'TEXT', 'INTEGER', 'FLOAT', 'DOUBLE']:
     634                                                out << textFieldElement(
     635                                                        description: it.name,
     636                                                        name: it.name
     637                                                )
     638                                                break
    635639                                        case 'STRINGLIST':
    636640                                                if (!it.listEntries.isEmpty()) {
     
    645649                                                }
    646650                                                break
    647                                         case 'STRING':
    648                                                 out << textFieldElement(
    649                                                         description: it.name,
    650                                                         name: it.name
    651                                                 )
    652                                                 break
    653651                                        case 'DATE':
    654652                                                out << dateElement(
    655                                                         description: it.name,
    656                                                         name: it.name
    657                                                 )
    658                                                 break
    659                                         case 'INTEGER':
    660                                                 out << textFieldElement(
    661                                                         description: it.name,
    662                                                         name: it.name
    663                                                 )
    664                                                 break
    665                                         case 'DOUBLE':
    666                                                 out << textFieldElement(
    667653                                                        description: it.name,
    668654                                                        name: it.name
Note: See TracChangeset for help on using the changeset viewer.