Changeset 567 for trunk/grails-app/taglib
- Timestamp:
- Jun 16, 2010, 1:55:55 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r565 r567 47 47 * @param Closure body 48 48 */ 49 def ajaxButton = { attrs, body ->49 def ajaxButton = { attrs, body -> 50 50 // get the jQuery version 51 51 def jQueryVersion = grailsApplication.getMetadata()['plugins.jquery'] … … 117 117 * @see WizardTagLib::baseElement (ajaxSubmitOnChange) 118 118 */ 119 def ajaxSubmitJs = { attrs, body ->119 def ajaxSubmitJs = { attrs, body -> 120 120 // define AJAX provider 121 121 setProvider([library: ajaxProvider]) … … 136 136 // change form if a form attribute is present 137 137 if (attrs.get('form')) { 138 // Old way 139 /* 140 button = button.replaceFirst(/this\.form/, 141 "\\\$('" + attrs.get('form') + "')" 142 ) 143 */ 144 145 button = button.replace("jQuery(this).parents('form:first')", 138 button = button.replace( 139 "jQuery(this).parents('form:first')", 146 140 "\$('" + attrs.get('form') + "')" 147 141 ) … … 174 168 * Example initial webflow action to work with this javascript: 175 169 * ... 176 * mainPage {* render(view: "/wizard/index") 177 * onRender {* flow.page = 1 178 *}* on("next").to "pageOne" 179 *}* ... 170 * mainPage { 171 * render(view: "/wizard/index") 172 * onRender { 173 * flow.page = 1 174 * } 175 * on("next").to "pageOne" 176 * } 177 * ... 180 178 * 181 179 * @param Map attributes 182 180 * @param Closure body 183 181 */ 184 def ajaxFlowRedirect = { attrs, body ->182 def ajaxFlowRedirect = { attrs, body -> 185 183 // generate javascript 186 184 out << '<script type="text/javascript">' … … 196 194 * @param Closure body (help text) 197 195 */ 198 def pageContent = { attrs, body ->196 def pageContent = { attrs, body -> 199 197 // define AJAX provider 200 198 setProvider([library: ajaxProvider]) … … 219 217 * @param Closure help content 220 218 */ 221 def baseElement = { inputElement, attrs, help ->219 def baseElement = { inputElement, attrs, help -> 222 220 println ".rendering [" + inputElement + "] with name [" + attrs.get('name') + "] and value [" + ((attrs.value) ? attrs.get('value').toString() : "-") + "]" 223 221 // work variables … … 340 338 * @param Closure body (help text) 341 339 */ 342 def textFieldElement = { attrs, body ->340 def textFieldElement = { attrs, body -> 343 341 // set default size, or scale to max length if it is less than the default size 344 342 if (!attrs.get("size")) { … … 363 361 * @param Closure body (help text) 364 362 */ 365 def textAreaElement = { attrs, body ->363 def textAreaElement = { attrs, body -> 366 364 // set default size, or scale to max length if it is less than the default size 367 365 … … 380 378 * @param Closure body (help text) 381 379 */ 382 def selectElement = { attrs, body ->380 def selectElement = { attrs, body -> 383 381 baseElement.call( 384 382 'select', … … 393 391 * @param Closure body (help text) 394 392 */ 395 def checkBoxElement = { attrs, body ->393 def checkBoxElement = { attrs, body -> 396 394 baseElement.call( 397 395 'checkBox', … … 439 437 * @param Closure body (help text) 440 438 */ 441 def dateElement = { attrs, body ->439 def dateElement = { attrs, body -> 442 440 // transform value? 443 441 if (attrs.value instanceof Date) { … … 467 465 * @param Closure body (help text) 468 466 */ 469 def timeElement = { attrs, body ->467 def timeElement = { attrs, body -> 470 468 // transform value? 471 469 if (attrs.value instanceof Date) { … … 494 492 * @param Closure help content 495 493 */ 496 def buttonElement = { attrs, body ->494 def buttonElement = { attrs, body -> 497 495 // render template element 498 496 baseElement.call( … … 524 522 def termSelect = { attrs -> 525 523 def from = [] 524 println "termSelect --> " + attrs 526 525 527 526 // got ontologies? … … 657 656 * @param Closure help content 658 657 */ 659 def templateElement = { attrs, body ->658 def templateElement = { attrs, body -> 660 659 // add a rel element if it does not exist 661 660 if (!attrs.rel) { … … 675 674 * @param Map attrs 676 675 */ 677 def templateSelect = { attrs ->676 def templateSelect = { attrs -> 678 677 def entity = attrs.remove('entity') 679 678 … … 773 772 * @param Closure help content 774 773 */ 775 def protocolElement = { attrs, body ->774 def protocolElement = { attrs, body -> 776 775 // render protocol element 777 776 baseElement.call( … … 786 785 * @param Map attrs 787 786 */ 788 def protocolSelect = { attrs ->787 def protocolSelect = { attrs -> 789 788 // fetch all protocold 790 789 attrs.from = Protocol.findAll() // for now, all protocols … … 798 797 } 799 798 800 def show = { attrs ->799 def show = { attrs -> 801 800 // is object parameter set? 802 801 def o = attrs.object … … 873 872 874 873 println ".SHOWING "+it.type.toString() 875 println it.ontologies876 874 877 875 switch (it.type.toString()) {
Note: See TracChangeset
for help on using the changeset viewer.