@@ -319,6 +319,7 @@ class FormFieldsTagLib {
319
319
* @attr order A comma-separated list of properties to include in provided order
320
320
* @attr except A comma-separated list of properties to exclude
321
321
* @attr theme Theme name
322
+ * @attr template OPTIONAL The template used when rendering the domainClass
322
323
*/
323
324
def display = { attrs , body ->
324
325
attrs = beanStack. innerAttributes + attrs
@@ -327,13 +328,15 @@ class FormFieldsTagLib {
327
328
328
329
String property = attrs. remove(PROPERTY_ATTR )
329
330
String templatesFolder = attrs. remove(TEMPLATES_ATTR )
330
- String theme = attrs. remove(THEME_ATTR )
331
+ String theme = attrs. remove(THEME_ATTR )
331
332
332
333
if (property == null ) {
333
334
PersistentEntity domainClass = resolveDomainClass(bean)
334
335
if (domainClass) {
336
+ String template = attrs. remove(' template' ) ?: ' list'
337
+
335
338
List properties = resolvePersistentProperties(domainClass, attrs)
336
- out << render(template : " /templates/_fields/list " , model : [domainClass : domainClass, domainProperties : properties]) { prop ->
339
+ out << render(template : " /templates/_fields/$t emplate " , model : [domainClass : domainClass, domainProperties : properties]) { prop ->
337
340
BeanPropertyAccessor propertyAccessor = resolveProperty(bean, prop. name)
338
341
Map model = buildModel(propertyAccessor, attrs, ' HTML' )
339
342
out << raw(renderDisplayWidget(propertyAccessor, model, attrs, templatesFolder, theme))
0 commit comments