Ignore:
Timestamp:
Feb 2, 2010, 1:58:18 PM (14 years ago)
Author:
duh
Message:
  • tag library now handles (INT and STRINGLIST) templateFields correctly
  • development.js can now reload CSS and JS on the fly (extermely handy for testing within flows)
  • some CSS changes
File:
1 edited

Legend:

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

    r157 r159  
    287287         */
    288288        def speciesSelect = { attrs ->
     289                // fetch the speciesOntology
     290                // note that this is a bit nasty, probably the ontologyName should
     291                // be configured in a configuration file... --> TODO
     292                def speciesOntology = Ontology.findByName('NCBI Taxonomy')
     293
    289294                // fetch all species
    290                 attrs.from = Term.findAll()     // for now, all terms, should be refactored to be species ontology only!
    291                 def speciesOntology = Ontology.findAllByName('NCBI Taxonomy')
    292 
    293                 println speciesOntology
    294                 //println Term.findAllByOntology(speciesOntology)
     295                attrs.from = Term.findAllByOntology(speciesOntology)
    295296
    296297                // got a name?
    297298                if (!attrs.name) {
     299                        // nope, use a default name
    298300                        attrs.name = 'species'
    299301                }
     
    355357                // output columns for these subjectFields
    356358                template.subjectFields.each() {
    357                         println it.type
    358359                        out << '<div class="' + attrs.get('class') + '">'
    359360
     
    361362                                case 'STRINGLIST':
    362363                                        // render stringlist subjectfield
    363                                         out << '<select><option>TODO</option></select>'
     364                                        if (!it.listEntries.isEmpty()) {
     365                                                out << select(
     366                                                        name: it.name,
     367                                                        from: it.listEntries
     368                                                )
     369                                        } else {
     370                                                out << '<span class="error">no values!!</span>'
     371                                        }
    364372                                        break;
    365373                                case 'INTEGER':
    366374                                        // render integer subjectfield
    367                                         out << '<input type="text" value="TODO">'
     375                                        out << textField(
     376                                                name: it.name
     377                                        )
    368378                                        break;
    369379                                default:
    370380                                        // unsupported field type
    371                                         out << '<b>!! ' + it.type + '</b>'
     381                                        out << '<span class="error">unsuported type '+it.type+'</span>'
    372382                                        break;
    373383                        }
Note: See TracChangeset for help on using the changeset viewer.