diff --git a/grails-app/taglib/au/org/ala/ecodata/forms/ModelTagLib.groovy b/grails-app/taglib/au/org/ala/ecodata/forms/ModelTagLib.groovy index fb1b73d..d962d3f 100644 --- a/grails-app/taglib/au/org/ala/ecodata/forms/ModelTagLib.groovy +++ b/grails-app/taglib/au/org/ala/ecodata/forms/ModelTagLib.groovy @@ -1009,8 +1009,12 @@ class ModelTagLib { } static boolean getAllowRowDelete(attrs, name, context) { - def ard = getAttribute(attrs, name, context, 'allowRowDelete') ?: 'true' - return ard.toBoolean() + Map dataModel = getAttribute(attrs.model.dataModel, name) + def allowRowDelete = true + if (dataModel?.allowRowDelete != null) { + allowRowDelete = Boolean.valueOf(dataModel.allowRowDelete) + } + allowRowDelete } @@ -1031,7 +1035,7 @@ class ModelTagLib { return target ? target[attribute] : null } - def getAttribute(model, name) { + static def getAttribute(Collection model, String name) { return model.findResult( { if (it.name == name) { diff --git a/src/test/groovy/au/org/ala/ecodata/forms/ModelTagLibSpec.groovy b/src/test/groovy/au/org/ala/ecodata/forms/ModelTagLibSpec.groovy index ab181cf..a95e638 100644 --- a/src/test/groovy/au/org/ala/ecodata/forms/ModelTagLibSpec.groovy +++ b/src/test/groovy/au/org/ala/ecodata/forms/ModelTagLibSpec.groovy @@ -147,4 +147,26 @@ class ModelTagLibSpec extends Specification implements TagLibUnitTest