Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ class FormFieldsTagLib {
* @attr order A comma-separated list of properties to include in provided order
* @attr except A comma-separated list of properties to exclude
* @attr theme Theme name
* @attr template OPTIONAL The template used when rendering the domainClass
*/
def display = { attrs, body ->
attrs = beanStack.innerAttributes + attrs
Expand All @@ -327,13 +328,15 @@ class FormFieldsTagLib {

String property = attrs.remove(PROPERTY_ATTR)
String templatesFolder = attrs.remove(TEMPLATES_ATTR)
String theme = attrs.remove(THEME_ATTR)
String theme = attrs.remove(THEME_ATTR)

if (property == null) {
PersistentEntity domainClass = resolveDomainClass(bean)
if (domainClass) {
String template = attrs.remove('template') ?: 'list'

List properties = resolvePersistentProperties(domainClass, attrs)
out << render(template: "/templates/_fields/list", model: [domainClass: domainClass, domainProperties: properties]) { prop ->
out << render(template: "/templates/_fields/$template", model: [domainClass: domainClass, domainProperties: properties]) { prop ->
BeanPropertyAccessor propertyAccessor = resolveProperty(bean, prop.name)
Map model = buildModel(propertyAccessor, attrs, 'HTML')
out << raw(renderDisplayWidget(propertyAccessor, model, attrs, templatesFolder, theme))
Expand Down