Changeset 415 for trunk/grails-app/taglib
- Timestamp:
- May 12, 2010, 1:23:35 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy
r359 r415 53 53 54 54 /** 55 * @param entities array in the format of columnindex:entitytype format55 * @param entities array 56 56 */ 57 57 def properties = { attrs -> … … 59 59 def header = attrs['header'] 60 60 61 attrs['entities'].each { se -> 62 def temp = se.split(":") 63 def entity = [type:temp[1],columnindex:temp[0]] 61 attrs['entities'].index.each { columnindex, entitytype -> 62 def entity = [type:entitytype,columnindex:columnindex.toInteger()] 64 63 selectedentities.add(entity) 65 64 } … … 70 69 /** 71 70 * Possibly this will later on return an AJAX-like autocompletion chooser for the fields? 72 * 71 * 72 * @param name name for the property chooser element 73 73 * @param importtemplate_id template identifier where fields are retrieved from 74 74 * @param MappingColumn object containing all required information … … 87 87 88 88 /** 89 * Create the property chooser select element 90 * 89 91 * @param name name of the HTML select object 90 92 * @param options list of options (fields) to be used … … 94 96 def createPropertySelect(String name, options, Integer columnIndex) 95 97 { 96 def res = "<select style=\"font-size:10px\" name=\"${name} \">"98 def res = "<select style=\"font-size:10px\" name=\"${name}.index.${columnIndex}\">" 97 99 98 100 options.each { f -> 99 res += "<option value=\"${ columnIndex}:${f.id}\""101 res += "<option value=\"${f.id}\"" 100 102 //res += (e.type.toInteger() == selected) ? " selected" : "" 101 103 res += ">${f}</option>" … … 120 122 def name = (attrs['name']==null) ? -1 : attrs['name'] 121 123 122 def res = "<select style=\"font-size:10px\" name=\"${name} \">"124 def res = "<select style=\"font-size:10px\" name=\"${name}.index.${custval}\">" 123 125 124 126 standardentities.each { e -> 125 res += "<option value=\"${ custval}:${e.type}\""127 res += "<option value=\"${e.type}\"" 126 128 res += (e.type == sel) ? " selected" : "" 127 129 res += ">${e.name}</option>" … … 133 135 134 136 /** 137 * Create a templatefieldtype selector 138 * 135 139 * @param selected selected TemplateFieldType 136 140 * @param customvalue custom value to be combined in the option(s) of the selector … … 142 146 def templatefieldtypeSelect = { attrs -> 143 147 def selected = (attrs['selected']==null) ? -1 : attrs['selected'] 144 def cust omvalue= (attrs['customvalue']==null) ? "" : attrs['customvalue']148 def custval = (attrs['customvalue']==null) ? "" : attrs['customvalue'] 145 149 def name = (attrs['name']==null) ? "" : attrs['name'] 146 150 147 def res = "<select style=\"font-size:10px\" name=\"${name} \">"151 def res = "<select style=\"font-size:10px\" name=\"${name}.index.${custval}\">" 148 152 149 153 TemplateFieldType.list().each { e -> 150 res += "<option value=\"${ customvalue}:${e}\""154 res += "<option value=\"${e}\"" 151 155 res += (e == selected) ? " selected" : "" 152 156 res += ">${e}</option>"
Note: See TracChangeset
for help on using the changeset viewer.