- Timestamp:
- Jan 22, 2010, 6:37:01 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r103 r107 156 156 157 157 /** 158 * wizard navigation buttons render wrapper, in order to be able to add159 * functionality in the future160 */161 def previousNext = {attrs ->162 // define AJAX provider163 setProvider([library: ajaxProvider])164 165 // render navigation buttons166 out << render(template: "/wizard/common/buttons")167 }168 169 /**170 158 * render the content of a particular wizard page 171 159 * @param Map attrs 172 * @param Closure body 160 * @param Closure body (help text) 173 161 */ 174 162 def pageContent = {attrs, body -> … … 187 175 /** 188 176 * render a textFieldElement 177 * @param Map attrs 178 * @param Closure body (help text) 189 179 */ 190 180 def textFieldElement = {attrs, body -> … … 198 188 } 199 189 190 // work variables 191 def addExampleElement = attrs.remove('addExampleElement') 192 //attrs.remove('addExampleElement') 193 200 194 // render a text element 201 195 out << '<div class="element">' … … 204 198 out << ' </div>' 205 199 out << ' <div class="input">' 200 201 // add text input field 206 202 out << textField(attrs) 203 204 // add a help icon if help information is available 205 if (body()) { 206 out << ' <div class="helpIcon" />' 207 } 208 209 // add an disabled input box for feedback purposes 210 // @see dateElement(...) 211 if (addExampleElement) { 212 def exampleAttrs = new LinkedHashMap() 213 exampleAttrs.name = attrs.get('name')+'Example' 214 exampleAttrs.class = 'isExample' 215 exampleAttrs.disabled = 'disabled' 216 out << textField(exampleAttrs) 217 } 218 219 // end HTML 207 220 out << ' </div>' 208 221 209 // add help icon?222 // add help content if it is available 210 223 if (body()) { 211 out << ' <div class="help">' 212 out << ' <div class="icon"></div>' 213 out << ' <div class="content">' 224 out << ' <div class="helpContent">' 214 225 out << ' ' + body() 215 226 out << ' </div>' 216 out << ' </div>'217 227 } 218 228 219 229 out << '</div>' 220 230 } 231 232 /** 233 * render a dateElement 234 * @param Map attrs 235 * @param Closure body (help text) 236 */ 237 def dateElement = { attrs, body -> 238 // set some textfield values 239 attrs.maxlength = 10 240 attrs.addExampleElement = true 241 242 // render a normal text field 243 out << textFieldElement(attrs,body) 244 245 // and attach the jquery-ui datepicker 246 out << '<script type="text/javascript">' 247 out << '$(document).ready(function() {' 248 out << ' $("#' + attrs.get('name') + '").datepicker({altField: \'#' + attrs.get('name') + 'Example\', altFormat: \'DD, d MM, yy\'});' 249 out << '});' 250 out << '</script>' 251 } 221 252 }
Note: See TracChangeset
for help on using the changeset viewer.