Changeset 341 for trunk/grails-app/taglib
- Timestamp:
- Apr 14, 2010, 11:36:53 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r299 r341 434 434 435 435 out << select(attrs) 436 } 437 438 439 /** 440 * Study form element 441 * @param Map attributes 442 * @param Closure help content 443 */ 444 def studyElement = { attrs, body -> 445 // render study element 446 baseElement.call( 447 'studySelect', 448 attrs, 449 body 450 ) 451 } 452 453 454 /** 455 * render a study select element 456 * @param Map attrs 457 */ 458 def studySelect = { attrs -> 459 // for now, just fetch all studies 460 attrs.from = Study.findAll() 461 462 // got a name? 463 if (!attrs.name) { 464 attrs.name = "study" 465 } 466 467 // got result? 468 if (attrs.from.size() > 0) { 469 out << select(attrs) 470 } else { 471 // no, return false to make sure this element 472 // is not rendered in the template 473 return false 474 } 436 475 } 437 476
Note: See TracChangeset
for help on using the changeset viewer.