- Timestamp:
- Feb 15, 2010, 9:38:24 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy
r173 r200 37 37 } 38 38 39 def createSelect(int selected, String name, ArrayList options) { 39 def entity = { attrs -> 40 out << entities[attrs['index']].name 41 } 42 43 /** 44 * @param entities array of entity:columnindex values 45 */ 46 def properties = { attrs -> 47 def ent = [] 48 49 attrs['entities'].each { e -> 50 def temp = e.split(":") 51 def entity = [type:temp[0],columnindex:temp[1]] 52 ent.add(entity) 53 } 54 55 out << render (template:"common/properties", model:[entities:ent]) 56 } 57 58 def createSelect(int selected, String name, ArrayList options, String customvalue) { 40 59 def res = "<select style=\"font-size:10px\" name=\"${name}\">" 41 60 42 61 options.each { e -> 43 res += "<option value=\"${e.value} \""62 res += "<option value=\"${e.value}:${customvalue}\"" 44 63 res += (e.value == selected) ? " selected" : "" 45 64 res += ">${e.name}</option>" … … 50 69 } 51 70 71 72 52 73 /** 53 74 * @param selected selected entity … … 56 77 def entitySelect = { attrs -> 57 78 def selected = (attrs['selected']==null) ? -1 : attrs['selected'] 58 out << createSelect(selected, attrs['name'], entities) 79 def customvalue = (attrs['customvalue']==null) ? "" : attrs['customvalue'] 80 out << createSelect(selected, attrs['name'], entities, customvalue) 59 81 } 60 82 … … 67 89 def celltypeSelect = { attrs -> 68 90 def selected = (attrs['selected']==null) ? -1 : attrs['selected'] 69 out << createSelect(selected, attrs['name'], celltypes) 91 def customvalue = (attrs['customvalue']==null) ? "" : attrs['customvalue'] 92 out << createSelect(selected, attrs['name'], celltypes, customvalue) 70 93 } 71 94 }
Note: See TracChangeset
for help on using the changeset viewer.