Changeset 159 for trunk/grails-app/taglib
- Timestamp:
- Feb 2, 2010, 1:58:18 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r157 r159 287 287 */ 288 288 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 289 294 // 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) 295 296 296 297 // got a name? 297 298 if (!attrs.name) { 299 // nope, use a default name 298 300 attrs.name = 'species' 299 301 } … … 355 357 // output columns for these subjectFields 356 358 template.subjectFields.each() { 357 println it.type358 359 out << '<div class="' + attrs.get('class') + '">' 359 360 … … 361 362 case 'STRINGLIST': 362 363 // 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 } 364 372 break; 365 373 case 'INTEGER': 366 374 // render integer subjectfield 367 out << '<input type="text" value="TODO">' 375 out << textField( 376 name: it.name 377 ) 368 378 break; 369 379 default: 370 380 // unsupported field type 371 out << '< b>!! ' + it.type + '</b>'381 out << '<span class="error">unsuported type '+it.type+'</span>' 372 382 break; 373 383 }
Note: See TracChangeset
for help on using the changeset viewer.