Changeset 250
- Timestamp:
- Mar 9, 2010, 2:16:07 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy
r247 r250 580 580 def value = params.get('subject_' + subjectId + '_' + subjectField.name) 581 581 582 // TODO: UNCOMMENT THISif (value) flow.subjects[ subjectId ].setFieldValue(subjectField.name, value)582 if (value) flow.subjects[ subjectId ].setFieldValue(subjectField.name, value) 583 583 } 584 584 -
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r247 r250 343 343 } 344 344 345 // add 'rel' field to identity the datefield using javascript 346 attrs.rel = 'date' 347 345 348 // set some textfield values 346 349 attrs.maxlength = (attrs.maxlength) ? attrs.maxlength : 10 … … 367 370 attrs.value = String.format('%td/%<tm/%<tY %<tH:%<tM', attrs.value) 368 371 } 372 373 // add 'rel' field to identity the field using javascript 374 attrs.rel = 'datetime' 369 375 370 376 attrs.addExampleElement = true … … 581 587 out << '<div class="' + attrs.get('class') + '">' 582 588 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 584 596 case 'STRINGLIST': 585 597 // render stringlist subjectfield … … 593 605 out << '<span class="warning">no values!!</span>' 594 606 } 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 610 608 default: 611 609 // unsupported field type … … 632 630 // render template fields 633 631 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 635 639 case 'STRINGLIST': 636 640 if (!it.listEntries.isEmpty()) { … … 645 649 } 646 650 break 647 case 'STRING':648 out << textFieldElement(649 description: it.name,650 name: it.name651 )652 break653 651 case 'DATE': 654 652 out << dateElement( 655 description: it.name,656 name: it.name657 )658 break659 case 'INTEGER':660 out << textFieldElement(661 description: it.name,662 name: it.name663 )664 break665 case 'DOUBLE':666 out << textFieldElement(667 653 description: it.name, 668 654 name: it.name -
trunk/grails-app/views/wizard/common/_error.gsp
r247 r250 21 21 <g:if test="${!e}"><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 50px 0;"></span></g:if> 22 22 ${error.value['key']} → ${error.value['value']} 23 ${error.value['dynamic']} 23 24 </p> 24 25 </g:each> … … 28 29 <g:each in="${errors}" var="error"> 29 30 <g:if test="${error.value['dynamic']}"> 30 $("input:[name='${error.key}'] ").addClass('error');31 $("input:[name='${error.key}'], select:[name='${error.key}']").addClass('error'); 31 32 </g:if><g:else> 32 $("input:[name='${error.key}'] ").parent().parent().addClass('error');33 $("input:[name='${error.key}'], select:[name='${error.key}']").parent().parent().addClass('error'); 33 34 </g:else> 34 35 </g:each> … … 37 38 $(function() { 38 39 $("div#wizardError").dialog({ 39 bgiframe: true,40 40 modal: true, 41 41 width: 600, -
trunk/web-app/js/wizard.js
r247 r250 26 26 27 27 // attach Tooltips 28 insertOnRedirectWarning(); 28 29 onWizardPage(); 29 30 }); … … 44 45 // accordeon(s) 45 46 $("#accordion").accordion(); 47 } 48 49 // insert a redirect confirmation dialogue to all anchors leading the 50 // user away from the wizard 51 function insertOnRedirectWarning() { 52 // find all anchors that lie outside the wizard 53 $('a').each(function() { 54 var element = $(this) 55 var re = /^#/gi; 56 57 if (!element.attr('href').match(/^#/gi) && !element.attr('href').match(/\/([^\/]+)\/wizard\/pages/gi)) { 58 // bind a warning to the onclick event 59 element.bind('click',function() { 60 return confirm('Warning: navigating away from the wizard causes loss of work and unsaved data. Are you sure you want to continue?'); 61 }) 62 } 63 }) 46 64 } 47 65 … … 117 135 // add datepickers to date fields 118 136 function attachDatePickers() { 119 $('div#wizard').find("input[type=text][ name$='Date']").each(function() {137 $('div#wizard').find("input[type=text][rel$='date']").each(function() { 120 138 $(this).datepicker({ 121 139 dateFormat : 'dd/mm/yy', … … 128 146 // add datetimepickers to date fields 129 147 function attachDateTimePickers() { 130 $('div#wizard').find("input[type=text][ name$='Time']").each(function() {148 $('div#wizard').find("input[type=text][rel$='datetime']").each(function() { 131 149 $(this).datepicker({ 132 150 dateFormat : 'dd/mm/yy',
Note: See TracChangeset
for help on using the changeset viewer.