Ignore:
Timestamp:
May 27, 2010, 4:26:44 PM (11 years ago)
Author:
tabma
Message:
  • simple wizard, tag library for properties added with a "allfieldtypes" = true/false to show all fields in the properties page instead of only filtered templatefieldtypes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy

    r485 r489  
    5656        def header = attrs['header']
    5757        def entities = attrs['entities']
     58        def allfieldtypes = (attrs['allfieldtypes']==null) ? "false" : "true"
     59        println attrs['allfieldtypes']
    5860
    5961        out << render ( template:"common/properties",
    6062                        model:[selectedentities:entities,
    6163                        standardentities:grailsApplication.config.gscf.domain.importableEntities,
    62                         header:header])
     64                        header:header,
     65                        allfieldtypes:allfieldtypes]
     66                        )
    6367    }
    6468
     
    6973     * @param importtemplate_id template identifier where fields are retrieved from
    7074     * @param MappingColumn object containing all required information
     75     * @param allfieldtypes boolean true if all templatefields should be listed, otherwise only show filtered templatefields
    7176     * @return chooser object
    7277     * */
     
    7782        def t = Template.get(session.importer_template_id)
    7883        def mc = attrs['mappingcolumn']
     84        def allfieldtypes = attrs['allfieldtypes']
     85
     86        def templatefields = (allfieldtypes=="true") ? t.fields.list() : t.fields.findAll { it.type == mc.templatefieldtype }
    7987
    8088        (mc.identifier) ? out << "<select style=\"font-size:10px\" name=\"\" disabled><option>Identifier</option></select>":
    81             out << createPropertySelect(attrs['name'], t.fields.findAll { it.type == mc.templatefieldtype }, mc.index)
     89            out << createPropertySelect(attrs['name'], templatefields, mc.index)
    8290    }
    8391
Note: See TracChangeset for help on using the changeset viewer.