dependencies {
+ implementation 'io.github.gpc:fields:6.0.0-SNAPSHOT'
+}
+From 92c9ac0369f8dba9a9cae51b8799e21db24f04f6 Mon Sep 17 00:00:00 2001
From: jdaugherty Groovy DocumentationAll Classes
Deprecated API
Contents
+
+
+
+
+
+
+
+
+
+ Property and Description
+
+
+
+
+
+ FormFieldsTagLib#input
+
+
+
+
+
+
+
+
+
+
+
+ Method and Description
+
+
+
+
+ BeanPropertyAccessor#getBeanClass()
+
+
[Groovy] Class Application<
+
+@groovy.transform.CompileStatic
+@grails.plugins.metadata.PluginSource
+class Application
+extends grails.boot.config.GrailsAutoConfiguration
[Groovy] Class Application<
+
+
+
+
@@ -179,7 +207,7 @@ Constructor Summary
+
+
+
+
+
+
+
+ Constructor and description
+
+
+
+
+
+ Application()
Inherited Methods Summary
@@ -203,6 +231,24 @@
- class grails.boot.config.GrailsAutoConfiguration
+ grails.boot.config.GrailsAutoConfiguration#getApplicationContext(), grails.boot.config.GrailsAutoConfiguration#getGrailsApplication(), grails.boot.config.GrailsAutoConfiguration#doWithSpring(), grails.boot.config.GrailsAutoConfiguration#doWithDynamicMethods(), grails.boot.config.GrailsAutoConfiguration#doWithApplicationContext(), grails.boot.config.GrailsAutoConfiguration#onConfigChange(java.util.Map), grails.boot.config.GrailsAutoConfiguration#onStartup(java.util.Map), grails.boot.config.GrailsAutoConfiguration#setApplicationContext(org.springframework.context.ApplicationContext), grails.boot.config.GrailsAutoConfiguration#grailsApplicationPostProcessor(), grails.boot.config.GrailsAutoConfiguration#getConfig(), grails.boot.config.GrailsAutoConfiguration#packageNames(), grails.boot.config.GrailsAutoConfiguration#invokeMethod(java.lang.String, java.lang.Object), grails.boot.config.GrailsAutoConfiguration#onShutdown(java.util.Map), grails.boot.config.GrailsAutoConfiguration#getMetaClass(), grails.boot.config.GrailsAutoConfiguration#setMetaClass(groovy.lang.MetaClass), grails.boot.config.GrailsAutoConfiguration#setProperty(java.lang.String, java.lang.Object), grails.boot.config.GrailsAutoConfiguration#getProperty(java.lang.String), grails.boot.config.GrailsAutoConfiguration#classes(), grails.boot.config.GrailsAutoConfiguration#packages(), grails.boot.config.GrailsAutoConfiguration#wait(long, int), grails.boot.config.GrailsAutoConfiguration#wait(long), grails.boot.config.GrailsAutoConfiguration#wait(), grails.boot.config.GrailsAutoConfiguration#equals(java.lang.Object), grails.boot.config.GrailsAutoConfiguration#toString(), grails.boot.config.GrailsAutoConfiguration#hashCode(), grails.boot.config.GrailsAutoConfiguration#getClass(), grails.boot.config.GrailsAutoConfiguration#notify(), grails.boot.config.GrailsAutoConfiguration#notifyAll()
grails.boot.config.GrailsAutoConfiguration#getConfig(), grails.boot.config.GrailsAutoConfiguration#packages(), grails.boot.config.GrailsAutoConfiguration#classes(), grails.boot.config.GrailsAutoConfiguration#packageNames(), grails.boot.config.GrailsAutoConfiguration#getMetaClass(), grails.boot.config.GrailsAutoConfiguration#setMetaClass(groovy.lang.MetaClass), grails.boot.config.GrailsAutoConfiguration#grailsApplicationPostProcessor(), grails.boot.config.GrailsAutoConfiguration#getApplicationContext(), grails.boot.config.GrailsAutoConfiguration#$getLookup(), grails.boot.config.GrailsAutoConfiguration#getGrailsApplication(), grails.boot.config.GrailsAutoConfiguration#setApplicationContext(org.springframework.context.ApplicationContext), grails.boot.config.GrailsAutoConfiguration#doWithSpring(), grails.boot.config.GrailsAutoConfiguration#doWithDynamicMethods(), grails.boot.config.GrailsAutoConfiguration#doWithApplicationContext(), grails.boot.config.GrailsAutoConfiguration#onConfigChange(java.util.Map), grails.boot.config.GrailsAutoConfiguration#onStartup(java.util.Map), grails.boot.config.GrailsAutoConfiguration#onShutdown(java.util.Map), grails.boot.config.GrailsAutoConfiguration#wait(long, int), grails.boot.config.GrailsAutoConfiguration#wait(), grails.boot.config.GrailsAutoConfiguration#wait(long), grails.boot.config.GrailsAutoConfiguration#equals(java.lang.Object), grails.boot.config.GrailsAutoConfiguration#toString(), grails.boot.config.GrailsAutoConfiguration#hashCode(), grails.boot.config.GrailsAutoConfiguration#getClass(), grails.boot.config.GrailsAutoConfiguration#notify(), grails.boot.config.GrailsAutoConfiguration#notifyAll(), grails.boot.config.GrailsAutoConfiguration#getProperty(java.lang.String), grails.boot.config.GrailsAutoConfiguration#setProperty(java.lang.String, java.lang.Object), grails.boot.config.GrailsAutoConfiguration#invokeMethod(java.lang.String, java.lang.Object)
Inherited Methods Summary
+
+
+
+
@@ -255,11 +301,11 @@ Constructor Detail
+
+
+
+
+
+ Application()
+
+ static void main(java.lang.String[] args)
[Groovy] Inter
@@ -138,110 +142,110 @@
+
+interface BeanPropertyAccessor
Methods Summary
-
- grails.core.GrailsDomainClass
+ getBeanClass()
+ abstract grails.core.GrailsDomainClass
getBeanClass()
-
- java.util.List<java.lang.Class>
+ getBeanSuperclasses()
@return all superclasses and interfaces of `beanType` excluding `Object`, `Serializable`, `Comparable` and `Cloneable`.
+ abstract java.util.List<java.lang.Class>
getBeanSuperclasses()
-
- java.lang.Class
+ getBeanType()
@return the type of the object that owns the property at the end of the path, e.g. for a `address.home.street` then the type of `home` is returned.
+ abstract java.lang.Class
getBeanType()
-
- org.grails.scaffolding.model.property.Constrained
+ getConstraints()
+ abstract Constrained
getConstraints()
-
- java.lang.String
+ getDefaultLabel()
@return default label text for the property at the end of the path.
+ abstract java.lang.String
getDefaultLabel()
-
- org.grails.datastore.mapping.model.PersistentProperty
+ getDomainProperty()
+ abstract org.grails.datastore.mapping.model.PersistentProperty
getDomainProperty()
-
- org.grails.datastore.mapping.model.PersistentEntity
+ getEntity()
+ abstract org.grails.datastore.mapping.model.PersistentEntity
getEntity()
-
- java.util.List<org.springframework.validation.FieldError>
+ getErrors()
+ abstract java.util.List<org.springframework.validation.FieldError>
getErrors()
-
- java.util.List<java.lang.String>
+ getLabelKeys()
@return the i18n keys used to resolve a label for the property at the end of the path in order of preference.
+ abstract java.util.List<java.lang.String>
getLabelKeys()
-
- java.lang.String
+ getPathFromRoot()
@return the full path from the root bean to the requested property.
+ abstract java.lang.String
getPathFromRoot()
-
- java.lang.String
+ getPropertyName()
@return the name of the property at the end of the path, e.g. for `address.home.street`, `street` is returned.
+ abstract java.lang.String
getPropertyName()
-
- java.lang.Class
+ getPropertyType()
@return the type of the property at the end of the path, e.g. for `address.home.street` then the type of `street` is returned.
+ abstract java.lang.Class
getPropertyType()
-
- java.util.List<java.lang.Class>
+ getPropertyTypeSuperclasses()
@return all superclasses and interfaces of `propertyType` excluding `Object`, `Serializable`, `Comparable` and `Cloneable`.
+ abstract java.util.List<java.lang.Class>
getPropertyTypeSuperclasses()
-
- java.lang.Object
+ getRootBean()
@return the object at the root of a path expression, e.g. for a `person` bean and `address.street` then `person` is returned.
+ abstract java.lang.Object
getRootBean()
-
- java.lang.Class
+ getRootBeanType()
@return the type of the object at the root of a path expression, e.g. for a `person` bean and `address.street` then the type of `person` is returned.
+ abstract java.lang.Class
getRootBeanType()
-
- java.lang.Object
+ getValue()
@return the value of the property at the end of the path, e.g. for `address.home.street` then the value of `street` is returned.
+ abstract java.lang.Object
getValue()
-
- boolean
+ isInvalid()
+ abstract boolean
isInvalid()
@@ -279,163 +283,144 @@
-
- boolean
+ isRequired()
+ abstract boolean
isRequired()
Method Detail
@java.lang.Deprecated
-grails.core.GrailsDomainClass getBeanClass()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
class BeanPropertyAccessorFactory -extends java.lang.Object - -- +
@groovy.transform.CompileStatic +class BeanPropertyAccessorFactory +extends java.lang.Object +implements grails.core.support.GrailsApplicationAware@@ -128,7 +128,7 @@
org.grails.scaffolding.model.property.DomainPropertyFactory
DomainPropertyFactory
fieldsDomainPropertyFactory
Constructor and description | +
---|
+ BeanPropertyAccessorFactory() |
+
BeanPropertyAccessor
accessorFor(java.lang.Object bean, java.lang.String propertyPath)
accessorFor(java.lang.Object bean, java.lang.String propertyPath)
class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
Groovy Documentation
diff --git a/snapshot/api/grails/plugin/formfields/BeanPropertyAccessorImpl.html b/snapshot/api/grails/plugin/formfields/BeanPropertyAccessorImpl.html index bb6d2a9f..6e388467 100644 --- a/snapshot/api/grails/plugin/formfields/BeanPropertyAccessorImpl.html +++ b/snapshot/api/grails/plugin/formfields/BeanPropertyAccessorImpl.html @@ -26,9 +26,9 @@ - -@groovy.transform.Canonical -@groovy.transform.TupleConstructor(includes = ['beanType', 'propertyName', 'propertyType']) + +@groovy.transform.CompileStatic +@groovy.transform.Canonical +@groovy.transform.TupleConstructor(includes: [beanType, propertyName, propertyType]) class BeanPropertyAccessorImpl extends java.lang.Object - -- - +implements BeanPropertyAccessor
org.grails.scaffolding.model.property.Constrained
Constrained
constraints
Constructor and description | +
---|
+ BeanPropertyAccessorImpl() |
+
protected static java.util.List<java.lang.Class>
getSuperclassesAndInterfaces(java.lang.Class type)
boolean
isInvalid()
boolean
isRequired()
class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
Groovy Documentation
diff --git a/snapshot/api/grails/plugin/formfields/DelegatingBeanPropertyAccessorImpl.html b/snapshot/api/grails/plugin/formfields/DelegatingBeanPropertyAccessorImpl.html index 83035039..09dae86f 100644 --- a/snapshot/api/grails/plugin/formfields/DelegatingBeanPropertyAccessorImpl.html +++ b/snapshot/api/grails/plugin/formfields/DelegatingBeanPropertyAccessorImpl.html @@ -26,9 +26,9 @@ - -@groovy.transform.CompileStatic -@groovy.transform.Canonical(includes = ['beanType', 'propertyName', 'propertyType']) +@groovy.transform.Canonical +@groovy.transform.ToString(includes: [beanType, propertyName, propertyType]) class DelegatingBeanPropertyAccessorImpl extends java.lang.Object - -- - +implements BeanPropertyAccessor
boolean
addPathFromRoot
java.lang.Class
beanType
java.lang.String
propertyName
java.lang.Class
propertyType
DelegatingBeanPropertyAccessorImpl
- (java.lang.Object rootBean, java.lang.Object value, java.lang.Class propertyType, java.lang.String pathFromRoot, org.grails.scaffolding.model.property.DomainProperty domainProperty)
DelegatingBeanPropertyAccessorImpl(java.lang.Object rootBean, java.lang.Object value, java.lang.Class propertyType, java.lang.String pathFromRoot, DomainProperty domainProperty, boolean addPathFromRoot)
org.grails.scaffolding.model.property.Constrained
Constrained
getConstraints()
class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
class FieldsGrailsPlugin +extends grails.plugins.Plugin
Constructor and description | +
---|
+ FieldsGrailsPlugin() |
+
class grails.plugins.Plugin
grails.plugins.Plugin#getApplicationContext(), grails.plugins.Plugin#getGrailsApplication(), grails.plugins.Plugin#setGrailsApplication(grails.core.GrailsApplication), grails.plugins.Plugin#getArtefacts(), grails.plugins.Plugin#doWithSpring(), grails.plugins.Plugin#doWithDynamicMethods(), grails.plugins.Plugin#doWithApplicationContext(), grails.plugins.Plugin#onChange(java.util.Map), grails.plugins.Plugin#onConfigChange(java.util.Map), grails.plugins.Plugin#onStartup(java.util.Map), grails.plugins.Plugin#beans(groovy.lang.Closure), grails.plugins.Plugin#setPlugin(grails.plugins.GrailsPlugin), grails.plugins.Plugin#setPluginManager(grails.plugins.GrailsPluginManager), grails.plugins.Plugin#setApplicationContext(org.springframework.context.ApplicationContext), grails.plugins.Plugin#getPluginManager(), grails.plugins.Plugin#getEnabled(), grails.plugins.Plugin#getPlugin(), grails.plugins.Plugin#getConfig(), grails.plugins.Plugin#getEnvironment(), grails.plugins.Plugin#setEnvironment(grails.util.Environment), grails.plugins.Plugin#isEnabled(), grails.plugins.Plugin#invokeMethod(java.lang.String, java.lang.Object), grails.plugins.Plugin#onShutdown(java.util.Map), grails.plugins.Plugin#setEnabled(boolean), grails.plugins.Plugin#getMetaClass(), grails.plugins.Plugin#setMetaClass(groovy.lang.MetaClass), grails.plugins.Plugin#getManager(), grails.plugins.Plugin#setProperty(java.lang.String, java.lang.Object), grails.plugins.Plugin#getProperty(java.lang.String), grails.plugins.Plugin#wait(long, int), grails.plugins.Plugin#wait(long), grails.plugins.Plugin#wait(), grails.plugins.Plugin#equals(java.lang.Object), grails.plugins.Plugin#toString(), grails.plugins.Plugin#hashCode(), grails.plugins.Plugin#getClass(), grails.plugins.Plugin#notify(), grails.plugins.Plugin#notifyAll()
grails.plugins.Plugin#getPluginManager(), grails.plugins.Plugin#getPlugin(), grails.plugins.Plugin#getEnabled(), grails.plugins.Plugin#getEnvironment(), grails.plugins.Plugin#setEnvironment(grails.util.Environment), grails.plugins.Plugin#onChange(java.util.Map), grails.plugins.Plugin#getConfig(), grails.plugins.Plugin#isEnabled(), grails.plugins.Plugin#setEnabled(boolean), grails.plugins.Plugin#getMetaClass(), grails.plugins.Plugin#setMetaClass(groovy.lang.MetaClass), grails.plugins.Plugin#getManager(), grails.plugins.Plugin#getApplicationContext(), grails.plugins.Plugin#$getLookup(), grails.plugins.Plugin#getGrailsApplication(), grails.plugins.Plugin#setGrailsApplication(grails.core.GrailsApplication), grails.plugins.Plugin#setApplicationContext(org.springframework.context.ApplicationContext), grails.plugins.Plugin#doWithSpring(), grails.plugins.Plugin#doWithDynamicMethods(), grails.plugins.Plugin#doWithApplicationContext(), grails.plugins.Plugin#onConfigChange(java.util.Map), grails.plugins.Plugin#onStartup(java.util.Map), grails.plugins.Plugin#beans(groovy.lang.Closure), grails.plugins.Plugin#setPlugin(grails.plugins.GrailsPlugin), grails.plugins.Plugin#setPluginManager(grails.plugins.GrailsPluginManager), grails.plugins.Plugin#getArtefacts(), grails.plugins.Plugin#onShutdown(java.util.Map), grails.plugins.Plugin#wait(long, int), grails.plugins.Plugin#wait(), grails.plugins.Plugin#wait(long), grails.plugins.Plugin#equals(java.lang.Object), grails.plugins.Plugin#toString(), grails.plugins.Plugin#hashCode(), grails.plugins.Plugin#getClass(), grails.plugins.Plugin#notify(), grails.plugins.Plugin#notifyAll(), grails.plugins.Plugin#getProperty(java.lang.String), grails.plugins.Plugin#setProperty(java.lang.String, java.lang.Object), grails.plugins.Plugin#invokeMethod(java.lang.String, java.lang.Object)
Groovy Documentation
diff --git a/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.BeanAndPrefix.html b/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.BeanAndPrefix.html index 6c29322b..996a1da7 100644 --- a/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.BeanAndPrefix.html +++ b/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.BeanAndPrefix.html @@ -26,9 +26,9 @@ - -class FormFieldsTagLib.BeanAndPrefix +extends java.lang.Object
Constructor and description | +
---|
+ FormFieldsTagLib.BeanAndPrefix() |
+
class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
Groovy Documentation
diff --git a/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.BeanAndPrefixStack.html b/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.BeanAndPrefixStack.html index 4c9bb396..fa6dca62 100644 --- a/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.BeanAndPrefixStack.html +++ b/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.BeanAndPrefixStack.html @@ -26,9 +26,9 @@ - -class FormFieldsTagLib.BeanAndPrefixStack +extends java.util.Stack<BeanAndPrefix>
Constructor and description | +
---|
+ FormFieldsTagLib.BeanAndPrefixStack() |
+
Methods inherited from class | -Name | -
---|---|
class java.util.Stack |
- java.util.Stack#push(java.lang.Object), java.util.Stack#pop(), java.util.Stack#peek(), java.util.Stack#empty(), java.util.Stack#search(java.lang.Object), java.util.Stack#add(java.lang.Object), java.util.Stack#add(int, java.lang.Object), java.util.Stack#remove(java.lang.Object), java.util.Stack#remove(int), java.util.Stack#get(int), java.util.Stack#equals(java.lang.Object), java.util.Stack#toString(), java.util.Stack#hashCode(), java.util.Stack#clone(), java.util.Stack#indexOf(java.lang.Object, int), java.util.Stack#indexOf(java.lang.Object), java.util.Stack#clear(), java.util.Stack#isEmpty(), java.util.Stack#lastIndexOf(java.lang.Object, int), java.util.Stack#lastIndexOf(java.lang.Object), java.util.Stack#contains(java.lang.Object), java.util.Stack#replaceAll(java.util.function.UnaryOperator), java.util.Stack#size(), java.util.Stack#subList(int, int), java.util.Stack#toArray(), java.util.Stack#toArray([Ljava.lang.Object;), java.util.Stack#iterator(), java.util.Stack#spliterator(), java.util.Stack#addAll(java.util.Collection), java.util.Stack#addAll(int, java.util.Collection), java.util.Stack#addElement(java.lang.Object), java.util.Stack#elementAt(int), java.util.Stack#elements(), java.util.Stack#forEach(java.util.function.Consumer), java.util.Stack#set(int, java.lang.Object), java.util.Stack#capacity(), java.util.Stack#ensureCapacity(int), java.util.Stack#trimToSize(), java.util.Stack#copyInto([Ljava.lang.Object;), java.util.Stack#setSize(int), java.util.Stack#firstElement(), java.util.Stack#lastElement(), java.util.Stack#setElementAt(java.lang.Object, int), java.util.Stack#removeElementAt(int), java.util.Stack#insertElementAt(java.lang.Object, int), java.util.Stack#removeElement(java.lang.Object), java.util.Stack#removeAllElements(), java.util.Stack#containsAll(java.util.Collection), java.util.Stack#removeAll(java.util.Collection), java.util.Stack#retainAll(java.util.Collection), java.util.Stack#listIterator(), java.util.Stack#listIterator(int), java.util.Stack#removeIf(java.util.function.Predicate), java.util.Stack#sort(java.util.Comparator), java.util.Stack#wait(long, int), java.util.Stack#wait(long), java.util.Stack#wait(), java.util.Stack#getClass(), java.util.Stack#notify(), java.util.Stack#notifyAll(), java.util.Stack#stream(), java.util.Stack#parallelStream() |
-
Groovy Documentation
diff --git a/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.html b/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.html index 3bc78ec6..bcdab08e 100644 --- a/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.html +++ b/snapshot/api/grails/plugin/formfields/FormFieldsTagLib.html @@ -26,9 +26,9 @@ - -@groovy.util.logging.Slf4j +class FormFieldsTagLib +extends java.lang.Object
java.lang.Object
all
java.lang.Object
display
java.lang.Object
displayWidget
org.grails.scaffolding.model.DomainModelService
DomainModelService
domainModelService
java.lang.Object
field
org.grails.scaffolding.model.property.DomainPropertyFactory
DomainPropertyFactory
fieldsDomainPropertyFactory
java.lang.Object
input
java.lang.Object
widget
java.lang.Object
with
Constructor and description | +
---|
+ FormFieldsTagLib() |
+
java.lang.CharSequence
renderDefaultInput(java.util.Map model, java.util.Map attrs = [:])
protected java.lang.CharSequence
renderDefaultField(java.util.Map model, java.util.Map attrs)
java.lang.CharSequence
renderDefaultInput(BeanPropertyAccessor propertyAccessor, java.util.Map model, java.util.Map attrs = [:])
renderDefaultInput(java.util.Map model, java.util.Map attrs)
java.lang.CharSequence
renderNumericInput(BeanPropertyAccessor propertyAccessor, java.util.Map model, java.util.Map attrs)
renderDefaultInput(BeanPropertyAccessor propertyAccessor, java.util.Map model, java.util.Map attrs)
java.lang.CharSequence
renderNumericInput(BeanPropertyAccessor propertyAccessor, java.util.Map model, java.util.Map attrs)
java.lang.CharSequence
renderStringInput(java.util.Map model, java.util.Map attrs)
class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
false
.Renders a collection of beans in a table
Groovy Documentation
diff --git a/snapshot/api/grails/plugin/formfields/FormFieldsTemplateService.html b/snapshot/api/grails/plugin/formfields/FormFieldsTemplateService.html index ebbe6e9d..0b85ef2d 100644 --- a/snapshot/api/grails/plugin/formfields/FormFieldsTemplateService.html +++ b/snapshot/api/grails/plugin/formfields/FormFieldsTemplateService.html @@ -26,9 +26,9 @@ - -@groovy.util.logging.Slf4j +@groovy.transform.CompileStatic +class FormFieldsTemplateService +extends java.lang.Object
Constructor and description | +
---|
+ FormFieldsTemplateService() |
+
java.util.Map
findTemplate(BeanPropertyAccessor propertyAccessor, java.lang.String templateName, java.lang.String templatesFolder, java.lang.String theme = null)
findTemplate(BeanPropertyAccessor propertyAccessor, java.lang.String templateName, java.lang.String templatesFolder, java.lang.String theme)
protected java.lang.String
getWidget(org.grails.scaffolding.model.property.Constrained cp, java.lang.Class propertyType)
getWidget(Constrained cp, java.lang.Class propertyType)
class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
Groovy Documentation
diff --git a/snapshot/api/grails/plugin/formfields/PropertyPathAccessor.html b/snapshot/api/grails/plugin/formfields/PropertyPathAccessor.html index 5c8c3ca6..fc5fbccb 100644 --- a/snapshot/api/grails/plugin/formfields/PropertyPathAccessor.html +++ b/snapshot/api/grails/plugin/formfields/PropertyPathAccessor.html @@ -26,9 +26,9 @@ - -@groovy.transform.CompileStatic -@groovy.transform.Canonical(includes = ['beanType', 'propertyName', 'propertyType']) +@groovy.transform.Canonical +@groovy.transform.ToString(includes: [beanType, propertyName, propertyType]) class PropertyPathAccessor extends java.lang.Object - -- - +implements BeanPropertyAccessor @@ -130,7 +130,7 @@
PropertyPathAccessor
- (java.lang.String pathFromRoot)
PropertyPathAccessor(java.lang.String pathFromRoot)
org.grails.scaffolding.model.property.Constrained
Constrained
getConstraints()
class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
Find the Changelog here
+Important
+The plugin is available on Maven Central and should be a dependency like this:
+dependencies {
+ implementation 'io.github.gpc:fields:6.0.0-SNAPSHOT'
+}
+The plugin provides a set of tags you can use to render the fields in a form.
New group
id. In your build.gradle file, use:
In the simplest case you can use f:all
to render a field for every property of a bean (the domain object or command the form will bind to):
compile 'io.github.gpc:fields:4.0.0-RC1'+
<g:form…>
+ <f:all bean="person"/>
+</g:form>
Changelog: -https://github.com/gpc/fields/compare/v3.0.0.RC1…v4.0.0-RC1
+To render individual fields you use the f:field
tag:
<g:form…>
+ <f:field bean="person" property="name"/>
+ <f:field bean="person" property="address"/>
+ <f:field bean="person" property="dateOfBirth"/>
+</g:form>
+Thank you for all the contributions!
+The f:field
tag will automatically handle embedded domain properties recursively:
<f:field bean="person" property="address"/>
Last version that is on the "old" group org.grails.plugins
If there is no bean object backing a form but you still want to render the surrounding field markup you can give f:field
a body:
<f:field property="password">
+ <g:password name="password"/>
+</f:field>
+Changelog: -https://github.com/gpc/fields/compare/v2.2.10…v3.0.0.RC1
+It should be an unusual case but to render just the widget without its surrounding container you can use the f:widget
tag:
<f:widget bean="person" property="name"/>
+To make it more convenient when rendering lots of properties of the same bean
you can use the f:with
tag to avoid having to specify bean
on any tags nested inside:
<g:form…>
+ <f:with bean="person">
+ <f:field property="name"/>
+ <f:field property="address"/>
+ <f:field property="dateOfBirth"/>
+ </f:with>
+</g:form>
+If you need to render a property for display purposes you can use f:display
. It will internally use g:fieldValue
, g:formatBoolean
or g:formatDate
to format the value.
<f:display bean="person" property="name"/>
+If you need to render the value in a different way you can give f:display
a body instead.
<f:display bean="person" property="dateOfBirth">
+ <g:formatDate format="dd MMM yyyy" date="${value}"/>
+</f:display>
+By default f:display
simply renders the property value but if you supply a \_display.gsp
template you can render the value in some structured markup, e.g. a table cell or list item. See the Customizing Field Rendering section for how to override templates. For example to render values in a definition list you could use a template like this:
<dt>${label}</dt>
+<dd>${value}</dd>
Changelog: -https://github.com/grails-fields-plugin/grails-fields/compare/v2.2.8…v2.2.9
+You can pass any number of extra attributes to the f:with
and f:all
tags that will be propagated to the inner fields and displays.
+See their individual tags sections for more information.
The names of the templates were changed for more adequate ones:
+BugFix: Table Tag does not render transient fields correctly (Issue #264)
+_field
to _wrapper
BugFix: Table Tag does not render references correctly! (Issue #269)
+_input
to _widget
BugFix: Fix XSS vulnerability when rendering beans (Issue #278) -GitHub diff
-BugFix: The fix for #257 did not work as described, but now it does.
-Improvement: Documentation has been improved with more examples for the various tags. -GitHub diff
-Improvement: Documentation of maxProperties
on <f:table/>
_display
to _displayWrapper
Improvement: <f:table\>
can now show id
, lastUpdated
and dateCreated
(see f:table doc). Injecting DomainModelService
instead of instantiating DomainModelServiceImpl
in FormsFieldTagLib
(Issue #257)
_displayWidget
was added
To use the old names (for backwards compatibility), configure the following in Config.groovy
Improvement: Introduced maxProperties
attribute to <f:table/>
Improvement: Render value that is an association but not to a grom entity
-Improvement: Rendering numbers is now Locale-aware (can be configured)
-grails.plugin.fields.wrapper = "field"
+grails.plugin.fields.displayWrapper = "display"
+grails.plugin.fields.widget = "input"
Bug-fix: Another issue with old API
-To pass additional attributes to widgets, prefix them with widget-.
Example:
<f:field property="birthDate" widget-format="dd/MM/yyyy"/>
Bug-fix: Fix issue with oneToMany expecting the old API
-To use the old prefix (for backwards compatibility), configure the following in Config.groovy
:
Bug-fix: Autowire beans
-grails.plugin.fields.widgetPrefix = "input-"
Conversion to the Mapping Context API. Usages of the GrailsDomainClass and GrailsDomainClassProperty classes have been removed. If you extend a template that relies on those classes, they have been replaced with PersistentEntity and DomainProperty respectively.
+The f:input
tag was deprecated because the name was confusing. Use the new f:widget
tag instead.
Conversion of constraints to a common implementation between grails.validation and grails.gorm.validation. See Constrained.
+The f:displayWidget
tag was added. It outputs the widget for display purposes, without the wrapper (similar to the widget
tag).
Upgrade to Grails 3.2.8
-Convert documentation to Asciidoc
-Add support for themes
-GitHub diff from 2.1.1 to 2.1.4
+All numbers are now rendered localized. This means that when using Locale.ENGLISH
the number 1000.50 is represented
+as 1,000.50
but with Locale.GERMAN
is represented as 1.000,50
. To use the old behavior (for backwards compatibility)
+without localizing the numbers, configure the following in Config.groovy
:
grails.plugin.fields.localizeNumbers = false
Redesign for Grails 3.0
-2015_04_26
See Browse issues
-The plugin resolves the GSP template used for each property according to conventions. You can override the rendering based
+on the class and property name or the property type. The f:field
tag looks for a template called _wrapper.gsp
, the f:widget
+tag looks for a template called _widget.gsp
, the f:display
tag looks for a template called _displayWrapper.gsp
.
-See Usage and Customizing Field Rendering for breaking changes. +Breaking changes in version 1.5 |
In version 1.5 a new template was introduced _displayWidget.gsp
. This is the corollary of _widget.gsp
for fields that
+are read-only, i.e. it is responsible for rendering just the markup for the field itself. Furthermore, the default names
+of all the templates were changed in this version, in the interest of clarity and consistency. The changes to the template
+names are summarized below:
Old Template Name (before v.1.5) | +New Template Name (v.1.5 onwards) | +
---|---|
|
+
|
+
|
+
|
+
N/A |
+
|
+
Users upgrading to 1.5 from a previous version should either rename their templates (recommended) or add the following
+to grails-app/conf/application.yml
to change the default templates names to the old names
grails:
+ plugin:
+ fields:
+ wrapper: field
+ displayWrapper: display
+ widget: input
+ displayWidget: displayWidget
+The template for a field is chosen by a convention using the names of the controller, action, bean class, bean property, theme, etc. All the tags will look for templates in the following directories in decreasing order of preference:
+Upgraded plugin to work with Grails 2.3.x (Issue #122)
+grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/*propertyName*/_themes/*themeName*/
Fixed missing property exception (Issue #134)
+grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/_themes/*themeName*/*propertyType*/
Fixed encoding in tag libraries (Issue #137)
+grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/_themes/*themeName*/
Configuring caching in dev mode (Issue #139)
+grails-app/views/*controllerNamespace*/*controllerName*/*propertyName*/_themes/*themeName*/
byte[] and Byte[] arrays types now look for files in byteArray folders (general for all array types) (Issue #144)
+grails-app/views/*controllerNamespace*/*controllerName*/_themes/*themeName*/*propertyType*/
2012-07-31
-Adds the f:display tag.
+grails-app/views/*controllerNamespace*/*controllerName*/_themes/*themeName*/
Supports overriding templates by property type or by default in individual controllers and actions.
+grails-app/views/*controllerName*/*actionName*/*propertyName*/_themes/*themeName*/
Browse issues -Thanks to https://github.com/cdeszaq,[Rick Jensen] https://github.com/delight,[Konstantinos Kostarellis] Gus Power and Eliot Sykes for their contributions.
-2012-03-16
-Pass attributes from f:field
to the rendered input using input-
prefix.
grails-app/views/*controllerName*/*actionName*/_themes/*themeName*/*propertyType*/
Optionally use entire property path for label key.
+grails-app/views/*controllerName*/*actionName*/_themes/*themeName*/
Browse issues -Thanks to Brian Saville and OverZealous for contributions.
-2012-03-11
-Adds the prefix attribute.
+grails-app/views/*controllerName*/*propertyName*/_themes/*themeName*/
Support widget:'textarea'
constraint.
grails-app/views/*controllerName*/_themes/*themeName*/*propertyType*/
grails-app/views/*controllerName*/_themes/*themeName*/
grails-app/views/_fields/_themes/*themeName*/*class*/*propertyName*/
grails-app/views/_fields/_themes/*themeName*/*superclass*/*propertyName*/
grails-app/views/_fields/_themes/*themeName*/*associationType*/
grails-app/views/_fields/_themes/*themeName*/*propertyType*/
grails-app/views/_fields/_themes/*themeName*/*propertySuperclass*/
grails-app/views/_fields/_themes/*themeName*/default/
grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/*propertyName*/
grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/*propertyType*/
grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/
grails-app/views/*controllerNamespace*/*controllerName*/*propertyName*/
grails-app/views/*controllerNamespace*/*controllerName*/*propertyType*/
grails-app/views/*controllerNamespace*/*controllerName*/
grails-app/views/*controllerName*/*actionName*/*propertyName*/
grails-app/views/*controllerName*/*actionName*/*propertyType*/
grails-app/views/*controllerName*/*actionName*/
grails-app/views/*controllerName*/*propertyName*/
grails-app/views/*controllerName*/*propertyType*/
grails-app/views/*controllerName*/
grails-app/views/_fields/*class*/*propertyName*/
grails-app/views/_fields/*superclass*/*propertyName*/
grails-app/views/_fields/*associationType*/
grails-app/views/_fields/*propertyType*/
grails-app/views/_fields/*propertySuperclass*/
grails-app/views/_fields/default/
Browse issues -Thanks to Brian Saville for contributions.
+The variables referenced in these paths are:
+Name | +Description | +
---|---|
controllerName |
+The name of the current controller (if any). |
+
actionName |
+The name of the current action (if any). |
+
themeName |
+Theme name specified as value of theme attribute (Optional). |
+
class |
+The bean class. For simple properties this is the class of the object passed to the |
+
superclass |
+Any superclass or interface of |
+
propertyName |
+The property name at the end of the chain passed to the |
+
propertyType |
+The type of the property at the end of the chain passed to the |
+
propertySuperclass |
+Any superclass or interface of |
+
associationType |
+One of |
+
All class names are camel-cased simple forms. For example java.lang.String
becomes string
, and com.project.HomeAddress
becomes homeAddress
.
Templates are resolved in this order so that you can override in the more specific circumstance and fall back to successively more general defaults. For example, you can define a field template for all java.lang.String
properties but override a specific property of a particular class to use more specialized rendering.
Templates in plugins are resolved as well. This means plugins such as Joda Time
can provide default rendering for special property types. A template in your application will take precedence over a template in a plugin at the same level. For example if a plugin provides a grails-app/views/_fields/string/_widget.gsp
the same template in your application will override it but if the plugin provides grails-app/views/_fields/person/name/_widget.gsp
it would be used in preference to the more general template in your application.
For most properties the out-of-the-box defaults should provide a good starting point.
2012-02-13: Bugfix release.
+Imagine an object of class Employee
that extends the class Person
and has a String name
property.
You can override the template f:field
uses with any of these:
grails-app/views/*controllerName*/*actionName*/name/_themes/*themeName*/_wrapper.gsp
grails-app/views/*controllerName*/*actionName*/name/_wrapper.gsp
grails-app/views/*controllerName*/*actionName*/string/_wrapper.gsp
grails-app/views/*controllerName*/*actionName*/_wrapper.gsp
grails-app/views/*controllerName*/name/_wrapper.gsp
grails-app/views/*controllerName*/string/_wrapper.gsp
grails-app/views/*controllerName*/_wrapper.gsp
grails-app/views/_fields/employee/name/_wrapper.gsp
grails-app/views/_fields/person/name/_wrapper.gsp
grails-app/views/_fields/string/_wrapper.gsp
grails-app/views/_fields/default/_wrapper.gsp
override the template f:widget
uses with any of these:
grails-app/views/*controllerName*/*actionName*/name/_themes/*themeName*/_widget.gsp
grails-app/views/*controllerName*/*actionName*/name/_widget.gsp
grails-app/views/*controllerName*/*actionName*/string/_widget.gsp
grails-app/views/*controllerName*/*actionName*/_widget.gsp
grails-app/views/*controllerName*/name/_widget.gsp
grails-app/views/*controllerName*/string/_widget.gsp
grails-app/views/*controllerName*/_widget.gsp
grails-app/views/_fields/employee/name/_widget.gsp
grails-app/views/_fields/person/name/_widget.gsp
grails-app/views/_fields/string/_widget.gsp
grails-app/views/_fields/default/_widget.gsp
And override the template f:display uses with any of these:
+grails-app/views/*controllerName*/*actionName*/name/_themes/*themeName*/_displayWrapper.gsp
grails-app/views/*controllerName*/*actionName*/name/_displayWrapper.gsp
grails-app/views/*controllerName*/*actionName*/string/_displayWrapper.gsp
grails-app/views/*controllerName*/*actionName*/_displayWrapper.gsp
grails-app/views/*controllerName*/name/_displayWrapper.gsp
grails-app/views/*controllerName*/string/_displayWrapper.gsp
grails-app/views/*controllerName*/_displayWrapper.gsp
grails-app/views/_fields/employee/name/_displayWrapper.gsp
grails-app/views/_fields/person/name/_displayWrapper.gsp
grails-app/views/_fields/string/_displayWrapper.gsp
grails-app/views/_fields/default/_displayWrapper.gsp
During template development it is usually recommended to disable template caching in order to allow the plugin to recognize new/renamed/moved templates without restarting the application. See the "Performance" section of the guide for the exact settings.
2012-02-09: Bugfix release.
+The plugin logs which locations it is checking for templates as debug log. You can enable this by defining a logger in logback.groovy
+logger('grails.plugin.formfields.FormFieldsTemplateService', DEBUG,['STDOUT'])+
The can disable the caching in application.yml using:
+grails: + plugin: + fields: + disableLookupCache: true+
2012-02-07: Bugfix release.
+If no template override is found the plugin will use the standard grails input tags (e.g. g:select
, g:checkbox
, g:field
) for rendering input controls.
+Using f:field
you can pass extra arguments (e.g. optionKey
, optionValue
) through to these tags by prefixing them with widget-
, e.g.
<f:field bean="person" property="gender" widget-optionValue="name"/>
+The f:field
and f:widget
tags will pass the following parameters to your templates or to the body of f:field
if you use one:
Name | +Type | +Description | +
---|---|---|
bean |
+Object |
+The |
+
property |
+String |
+The |
+
type |
+Class |
+The property type. |
+
label |
+String |
+The field label text. This is based on the |
+
value |
+Object |
+the property value. This can also be overridden or defaulted if the |
+
constraints |
+ConstrainedProperty |
+The constraints for the property if the bean is a domain or command object. |
+
persistentProperty |
++ | The persistent property object if the bean is a domain object. |
+
errors |
+List<String> |
+The error messages for any field errors present on the property. If there are no errors this will be an empty List. |
+
required |
+boolean |
+
|
+
invalid |
+boolean |
+
|
+
prefix |
+String |
+A string (including the trailing period) that should be appended before the input name such as |
+
In addition f:field
passes the following parameters:
Name |
+Type |
+Description |
+
widget |
+String |
+The output of |
+
+ + | +
+If the bean attribute was not supplied to f:field then bean , type , value and persistentProperty will all be null .
+ |
+
2012-02-03: Bugfix release.
+If the label
attribute is not supplied to the f:field
tag then the label string passed to the field template is resolved by convention. The plugin uses the following order of preference for the label:
An i18n message using the key beanClass.path.label. For example when using <f:field bean="authorInstance" property="book.title"/>
the plugin will try the i18n key author.book.title.label
. If the property path contains any index it is removed so <f:field bean="authorInstance" property="books<<0>>.title"/>
would use the key author.books.title.label
.
For classes using the same bean class as properties, it is possible to get a key without the class name prefixed. If the configuration value grails.plugin.fields.i18n.addPathFromRoot
is set to true
(default: false
). Example: a class Publisher
has two Address
properties authorAddress
and printAddress
. With addPathFromRoot=true
they will share the key address.city.label
. The same goes if Author
and Publisher
had a Book book
, the key would be book.title.label
, and if they both had a List<Book> books
the key would be books.title.label
An i18n message using the key objectType.propertyName`.label`. For example when using <f:field bean="personInstance" property="address.city"/>
the plugin will try the i18n key address.city.label
.
The natural property name. For example when using <f:field bean="personInstance" property="dateOfBirth"/>
the plugin will use the label "Date Of Birth"
.
The plugin provides a set of tags you can use to render the fields in a form.
+Rather than relying on the convention described previously to locate the template(s) to be used for a particular field, it is +instead possible to directly specify the directory containing the templates. This feature was introduced in version 1.5.
In the simplest case you can use f:all
to render a field for every property of a bean (the domain object or command the form will bind to):
The wrapper
attribute can be used with the f:field or f:display tags to specify the directory containing the _wrapper.gsp
or _displayWrapper.gsp
template to be used
The widget
attribute can be used with the f:field or f:display tags to specify the directory containing the _widget.gsp
or _displayWidget.gsp
template to be used
If the wrapper and widget templates both have the same value, the templates
attribute can be used instead as a shorthand. For example:
<g:form…>
- <f:all bean="person"/>
-</g:form>
+<f:field property="startDate" templates="bootstrap3" />
To render individual fields you use the f:field
tag:
is equivalent to:
<g:form…>
- <f:field bean="person" property="name"/>
- <f:field bean="person" property="address"/>
- <f:field bean="person" property="dateOfBirth"/>
-</g:form>
+<f:field property="startDate" wrapper="bootstrap3" widget="bootstrap3" />
The f:field
tag will automatically handle embedded domain properties recursively:
if theme is specified, theme will be searched first to find the templates +For example
<f:field bean="person" property="address"/>
+<f:field property="startDate" templates="custom" theme="bs-horizontal"/>
If there is no bean object backing a form but you still want to render the surrounding field markup you can give f:field
a body:
<f:field property="password">
- <g:password name="password"/>
-</f:field>
-Will search the templates first in \_fields/_themes/bs-horizontal/custom and then \_fields/custom
It should be an unusual case but to render just the widget without its surrounding container you can use the f:widget
tag:
<f:widget bean="person" property="name"/>
-If a direct location is specified, and the templates cannot be found therein, the plugin will fall back to locating templates +by convention.
To make it more convenient when rendering lots of properties of the same bean
you can use the f:with
tag to avoid having to specify bean
on any tags nested inside:
<g:form…>
- <f:with bean="person">
- <f:field property="name"/>
- <f:field property="address"/>
- <f:field property="dateOfBirth"/>
- </f:with>
-</g:form>
+// renders _fields/\_themes/bs-horizontal/custom/_wrapper.gsp:
+<f:field property="startDate" wrapper="custom" theme="bs-horizontal"/>
+
+// renders _fields/bootstrap3/_wrapper.gsp:
+<f:field property="startDate" wrapper="bootstrap3"/>
+
+// renders _fields/time/_widget.gsp:
+<f:field property="startDate" widget="time"/>
+
+// renders _fields/time/_wrapper.gsp and _fields/time/_widget.gsp:
+<f:field property="startDate" templates="time"/>
+
+// renders _fields/\_themes/bs-horizontal/custom/_displayWrapper.gsp:
+<f:display property="startDate" wrapper="custom" theme="bs-horizontal"/>
+
+
+// renders _fields/bootstrap3/_displayWrapper.gsp:
+<f:display property="startDate" wrapper="bootstrap3"/>
+
+// renders _fields/time/_displayWidget.gsp:
+<f:display property="startDate" widget="time"/>
+
+// renders _fields/time/_displayWrapper.gsp and _fields/time/_displayWidget.gsp:
+<f:display property="startDate" templates="time"/>
If you need to render a property for display purposes you can use f:display
. It will internally use g:fieldValue
, g:formatBoolean
or g:formatDate
to format the value.
<f:display bean="person" property="name"/>
If you need to render the value in a different way you can give f:display
a body instead.
Embedded properties are handled in a special way by the f:field
and f:all
tags. If the property
attribute you pass to f:field
is an embedded property then the tag recursively renders each individual property of the embedded class with a surrounding fieldset
. For example if you have a Person
class with a name
property and an Address
embedded class with street
, city
and country
properties <f:field bean="person" property="address">
will effectively do this:
<f:display bean="person" property="dateOfBirth">
- <g:formatDate format="dd MMM yyyy" date="${value}"/>
-</f:display>
+<fieldset class="embedded address">
+ <legend>Address</legend>
+ <f:field bean="person" property="address.street"/>
+ <f:field bean="person" property="address.city"/>
+ <f:field bean="person" property="address.country"/>
+</fieldset>
By default f:display
simply renders the property value but if you supply a \_display.gsp
template you can render the value in some structured markup, e.g. a table cell or list item. See the Customizing Field Rendering section for how to override templates. For example to render values in a definition list you could use a template like this:
<dt>${label}</dt>
-<dd>${value}</dd>
-You can customize how embedded properties are surrounded by providing a layout at grails-app/views/layouts/_fields/embedded.gsp
which will override the default layout provided by the plugin.
You can pass any number of extra attributes to the f:with
and f:all
tags that will be propagated to the inner fields and displays.
-See their individual tags sections for more information.
When you use the f:all
tag it will automatically handle embedded properties in this way.
The names of the templates were changed for more adequate ones:
-_field
to _wrapper
_input
to _widget
_display
to _displayWrapper
_displayWidget
was added
Since version 2.1.4 It is possible to create themes to provide set of templates for different css frameworks or form layouts. +For example, a bootstrap-fields plugin can provide different themes (eg bs-horizontal, bs-vertical) to support horizontal and vertical form layouts. And another plugin can provide theme for purecss framework.
To use the old names (for backwards compatibility), configure the following in Config.groovy
Themes are put under directory _fields/themes/*themeName*/
.
grails.plugin.fields.wrapper = "field"
-grails.plugin.fields.displayWrapper = "display"
-grails.plugin.fields.widget = "input"
+All of the field tags supports theme attribute which accepts the name of the theme. When a theme name is specified, widget, wrapper, and display templates will be searched in theme directory first as described in Customizing Field Rendering.
To pass additional attributes to widgets, prefix them with widget-.
+Plugins can include field and/or input level templates to support special UI rendering or non-standard property types. Just include the templates in the plugin’s grails-app/views
directory as described in the Customizing Field Rendering section.
Example:
++ + | +
+If you supply templates in a plugin you should consider declaring a <%@page defaultCodec="html" %> directive so that any HTML unsafe property values are escaped properly regardless of the default codec used by client apps.
+ |
+
<f:field property="birthDate" widget-format="dd/MM/yyyy"/>
+In order to be performant, the Fields plugin caches field template lookup results by default. This makes it possible to perform the time-consuming template path resolutions only once during the runtime of the application.
When template caching is active, only the first page renderings are slow, subsequent ones are fast.
To use the old prefix (for backwards compatibility), configure the following in Config.groovy
:
Due to the flexibility needed during template development, this feature can be disabled so it would be possible to recognize newly added field templates without restarting the application. As a result, with bigger webpages, containing a lot of fields, rendering may be fairly slow in development (depending on the number of fields on the page).
grails.plugin.fields.widgetPrefix = "input-"
For template development, the following configuration attribute should be placed in the development environment section of your application’s Config.groovy:
The f:input
tag was deprecated because the name was confusing. Use the new f:widget
tag instead.
The f:displayWidget
tag was added. It outputs the widget for display purposes, without the wrapper (similar to the widget
tag).
grails.plugin.fields.disableLookupCache = true
All numbers are now rendered localized. This means that when using Locale.ENGLISH
the number 1000.50 is represented
-as 1,000.50
but with Locale.GERMAN
is represented as 1.000,50
. To use the old behavior (for backwards compatibility)
-without localizing the numbers, configure the following in Config.groovy
:
or
grails.plugin.fields.localizeNumbers = false
+environments:
+ development:
+ grails:
+ plugin:
+ fields:
+ disableLookupCache: true
After the template development has finished, it is recommended to re-enable the template lookup cache in order to have a performant page rendering even during development.
The plugin resolves the GSP template used for each property according to conventions. You can override the rendering based
-on the class and property name or the property type. The f:field
tag looks for a template called _wrapper.gsp
, the f:widget
-tag looks for a template called _widget.gsp
, the f:display
tag looks for a template called _displayWrapper.gsp
.
- - | --Breaking changes in version 1.5 - | -
Renders fields for all properties of an object by using f:field
for each property.
In version 1.5 a new template was introduced _displayWidget.gsp
. This is the corollary of _widget.gsp
for fields that
-are read-only, i.e. it is responsible for rendering just the markup for the field itself. Furthermore, the default names
-of all the templates were changed in this version, in the interest of clarity and consistency. The changes to the template
-names are summarized below:
The id
, version
, dateCreated
and lastUpdated
properties are skipped on domain classes. Additionally any property with a display: false
constraint set will be skipped.
Old Template Name (before v.1.5) | -New Template Name (v.1.5 onwards) | +Name | +Required | +Description |
---|---|---|---|---|
|
-
|
+bean |
+if not inside |
+The bean whose property is being rendered. This can be the object itself or the name of a page-scope variable. |
|
-
|
+except |
+N/A |
+A comma-separated list of properties that should be skipped (in addition to the defaults). |
order |
N/A |
-
|
+A comma-separated list of properties which represents the order in which the tag should generate fields. |
+|
prefix |
+String |
+A string (including the trailing period) that should be appended before the input name such as |
+||
theme |
+String |
+Theme to use if available. |
Users upgrading to 1.5 from a previous version should either rename their templates (recommended) or add the following
-to grails-app/conf/application.yml
to change the default templates names to the old names
You can pass extra attributes to the all tag that will be propagated to the inner fields.
+grails:
- plugin:
- fields:
- wrapper: field
- displayWrapper: display
- widget: input
- displayWidget: displayWidget
+<f:all bean="person" wrapper="someWrapper"/>
The template for a field is chosen by a convention using the names of the controller, action, bean class, bean property, theme, etc. All the tags will look for templates in the following directories in decreasing order of preference:
+In that way all the fields are going to be executed as if they were executed with the extra attribute on them.
++ + | ++Remember that if you want to use some of those attributes in the widget templates you need to prefix them with the widget- word (unless you have configured another prefix) + | +
f:display
renders a property for display. If there is no _displayWrapper
template in scope the tag will simply render the property value.
f:display
template will look for a _displayWrapper
for the wrapper itself and a _displayWidget
for the widget used inside the wrapper template.
If the f:display
tag has a body its output is used as the value passed as the value
model to the _display
template. If there is no body then the raw property value is passed to g:fieldValue
, g:formatDate
or g:formatBoolean
depending on its type and the result is passed as the value
model to the _display
template.
+ + | ++In version 1.5 new attributes were added: +Since then you can specify the folders where the templates are located. You can do this for the wrapper folder, the widget folder ot both (if they are located on the same folder). + | +
<f:display bean="person"/>
+
+<f:display bean="person" displayStyle="table"/>
+
+<f:display bean="person" property="name"/>
+
+// renders widget and wrapper from subdirectory of _fields/_themes/purecss if defined
+<f:display bean="person" property="name" theme="purecss"/>
+
+// renders _fields/bootstrap3/_displayWrapper.gsp:
+<f:display bean="person" property="name" wrapper="bootstrap3"/>
+
+// renders _fields/maskedInput/_displayWidget.gsp:
+<f:display bean="person" property="name" widget="maskedInput"/>
+
+// renders _fields/maskedInput/_displayWrapper.gsp and _fields/maskedInput/_displayWidget.gsp:
+<f:display bean="person" property="name" templates="maskedInput"/>
+
+<f:display bean="person" property="dateOfBirth">
+ <g:formatDate format="dd MMM yyyy" date="${value}"/>
+</f:display>
grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/*propertyName*/_themes/*themeName*/
grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/_themes/*themeName*/*propertyType*/
grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/_themes/*themeName*/
grails-app/views/*controllerNamespace*/*controllerName*/*propertyName*/_themes/*themeName*/
grails-app/views/*controllerNamespace*/*controllerName*/_themes/*themeName*/*propertyType*/
grails-app/views/*controllerNamespace*/*controllerName*/_themes/*themeName*/
grails-app/views/*controllerName*/*actionName*/*propertyName*/_themes/*themeName*/
grails-app/views/*controllerName*/*actionName*/_themes/*themeName*/*propertyType*/
grails-app/views/*controllerName*/*actionName*/_themes/*themeName*/
grails-app/views/*controllerName*/*propertyName*/_themes/*themeName*/
grails-app/views/*controllerName*/_themes/*themeName*/*propertyType*/
grails-app/views/*controllerName*/_themes/*themeName*/
grails-app/views/_fields/_themes/*themeName*/*class*/*propertyName*/
grails-app/views/_fields/_themes/*themeName*/*superclass*/*propertyName*/
grails-app/views/_fields/_themes/*themeName*/*associationType*/
grails-app/views/_fields/_themes/*themeName*/*propertyType*/
grails-app/views/_fields/_themes/*themeName*/*propertySuperclass*/
grails-app/views/_fields/_themes/*themeName*/default/
grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/*propertyName*/
grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/*propertyType*/
grails-app/views/*controllerNamespace*/*controllerName*/*actionName*/
grails-app/views/*controllerNamespace*/*controllerName*/*propertyName*/
grails-app/views/*controllerNamespace*/*controllerName*/*propertyType*/
grails-app/views/*controllerNamespace*/*controllerName*/
grails-app/views/*controllerName*/*actionName*/*propertyName*/
grails-app/views/*controllerName*/*actionName*/*propertyType*/
grails-app/views/*controllerName*/*actionName*/
grails-app/views/*controllerName*/*propertyName*/
grails-app/views/*controllerName*/*propertyType*/
grails-app/views/*controllerName*/
grails-app/views/_fields/*class*/*propertyName*/
grails-app/views/_fields/*superclass*/*propertyName*/
grails-app/views/_fields/*associationType*/
grails-app/views/_fields/*propertyType*/
grails-app/views/_fields/*propertySuperclass*/
grails-app/views/_fields/default/
The variables referenced in these paths are:
Name | +Required | Description | ||
---|---|---|---|---|
controllerName |
-The name of the current controller (if any). |
+bean |
+if not inside |
+The bean whose property is being rendered. This can be the object itself or the name of a page-scope variable. |
actionName |
-The name of the current action (if any). |
+property |
+No |
+The path to the property. This can include any level of nesting and numeric or string indexes. For example |
themeName |
-Theme name specified as value of theme attribute (Optional). |
+value |
+No |
+Overrides the actual value of the property. |
class |
-The bean class. For simple properties this is the class of the object passed to the |
+default |
+No |
+A default value for the property that will be used if the actual property value is |
superclass |
-Any superclass or interface of |
+label |
+No |
+Overrides the field label passed to the template. This value may either be an i18n key or a literal string. |
propertyName |
-The property name at the end of the chain passed to the |
+displayStyle |
+No |
+When specified and different from the string |
propertyType |
-The type of the property at the end of the chain passed to the |
+except |
+No |
+A comma-separated list of properties that should be skipped. |
propertySuperclass |
-Any superclass or interface of |
+order |
+No |
+A comma-separated list of properties which represents the order in which the tag should display them. |
associationType |
-One of |
+theme |
+No |
+Theme to use if available. The theme can define a new directory structure in /_fields/_themes/<themename> which will take priority over templates, wrapper and widget if they are specified, as it is injecting the search path first in the list. |
+
templates |
+No |
+Specify the folder inside _fields where to look up for the wrapper and widget template. |
+||
widget |
+No |
+Specify the folder inside _fields where to look up for the widget template. |
+||
wrapper |
+No |
+Specify the folder inside _fields where to look up for the wrapper template. |
All class names are camel-cased simple forms. For example java.lang.String
becomes string
, and com.project.HomeAddress
becomes homeAddress
.
Templates are resolved in this order so that you can override in the more specific circumstance and fall back to successively more general defaults. For example, you can define a field template for all java.lang.String
properties but override a specific property of a particular class to use more specialized rendering.
Templates in plugins are resolved as well. This means plugins such as Joda Time
can provide default rendering for special property types. A template in your application will take precedence over a template in a plugin at the same level. For example if a plugin provides a grails-app/views/_fields/string/_widget.gsp
the same template in your application will override it but if the plugin provides grails-app/views/_fields/person/name/_widget.gsp
it would be used in preference to the more general template in your application.
For most properties the out-of-the-box defaults should provide a good starting point.
+Any additional attributes are passed to the rendered template.
Imagine an object of class Employee
that extends the class Person
and has a String name
property.
You can override the template f:field
uses with any of these:
grails-app/views/*controllerName*/*actionName*/name/_themes/*themeName*/_wrapper.gsp
grails-app/views/*controllerName*/*actionName*/name/_wrapper.gsp
grails-app/views/*controllerName*/*actionName*/string/_wrapper.gsp
grails-app/views/*controllerName*/*actionName*/_wrapper.gsp
grails-app/views/*controllerName*/name/_wrapper.gsp
grails-app/views/*controllerName*/string/_wrapper.gsp
grails-app/views/*controllerName*/_wrapper.gsp
grails-app/views/_fields/employee/name/_wrapper.gsp
grails-app/views/_fields/person/name/_wrapper.gsp
grails-app/views/_fields/string/_wrapper.gsp
grails-app/views/_fields/default/_wrapper.gsp
When f:display
is used without a property
then all bean properties are rendered. This is done with the grails-app/views/templates/_fields/_list.gsp
template. The default template can be found on GitHub
override the template f:widget
uses with any of these:
grails-app/views/*controllerName*/*actionName*/name/_themes/*themeName*/_widget.gsp
grails-app/views/*controllerName*/*actionName*/name/_widget.gsp
grails-app/views/*controllerName*/*actionName*/string/_widget.gsp
grails-app/views/*controllerName*/*actionName*/_widget.gsp
grails-app/views/*controllerName*/name/_widget.gsp
grails-app/views/*controllerName*/string/_widget.gsp
grails-app/views/*controllerName*/_widget.gsp
grails-app/views/_fields/employee/name/_widget.gsp
grails-app/views/_fields/person/name/_widget.gsp
grails-app/views/_fields/string/_widget.gsp
grails-app/views/_fields/default/_widget.gsp
And override the template f:display uses with any of these:
+f:displayWidget
renders an appropriate widget for a display property, for example an <span>${value}</span>
element for a String
property.
grails-app/views/*controllerName*/*actionName*/name/_themes/*themeName*/_displayWrapper.gsp
grails-app/views/*controllerName*/*actionName*/name/_displayWrapper.gsp
grails-app/views/*controllerName*/*actionName*/string/_displayWrapper.gsp
grails-app/views/*controllerName*/*actionName*/_displayWrapper.gsp
grails-app/views/*controllerName*/name/_displayWrapper.gsp
grails-app/views/*controllerName*/string/_displayWrapper.gsp
grails-app/views/*controllerName*/_displayWrapper.gsp
grails-app/views/_fields/employee/name/_displayWrapper.gsp
grails-app/views/_fields/person/name/_displayWrapper.gsp
grails-app/views/_fields/string/_displayWrapper.gsp
grails-app/views/_fields/default/_displayWrapper.gsp
+ + | +
+Using f:displayWidget directly will only be necessary for very specialized cases, usually it will be invoked via f:display .
+ |
+
During template development it is usually recommended to disable template caching in order to allow the plugin to recognize new/renamed/moved templates without restarting the application. See the "Performance" section of the guide for the exact settings.
+f:displayWidget
accepts exactly the same attributes as the f:display tag (except for wrapper
and templates
attributes).
_displayWidget.gsp
The plugin logs which locations it is checking for templates as debug log. You can enable this by defining a logger in logback.groovy
+If you have a domain class with a java.time.LocalDate
you might want to format it specially:
logger('grails.plugin.formfields.FormFieldsTemplateService', DEBUG,['STDOUT'])+
<%@ page import="java.time.format.DateTimeFormatter" %> +<g:set var="localDatePattern" value="${message(code: 'default.localDate.format',default: 'yyyy-MM-dd')}"/> +${value?.format(DateTimeFormatter.ofPattern(localDatePattern, request.getLocale()))}+
f:field
renders the widget using either f:widget
or the tag body accompanied by any surrounding markup, typically a container, a label
tag and any validation messages.
The can disable the caching in application.yml using:
+By default the f:field
tag will output:
grails: - plugin: - fields: - disableLookupCache: true+
<div class="fieldcontain">
+ <label for="foo">Foo</label>
+ <!-- the widget as generated by f:widget or the tag body -->
+</div>
The intention is that f:field
should typically be used without
a tag body. For example:
<f:field bean="person" property="name"/>
+If no template override is found the plugin will use the standard grails input tags (e.g. g:select
, g:checkbox
, g:field
) for rendering input controls.
-Using f:field
you can pass extra arguments (e.g. optionKey
, optionValue
) through to these tags by prefixing them with widget-
, e.g.
In which case the tag will use f:widget
to generate an appropriate input. Alternatively in more specialized cases you can give f:field
a tag body. For example:
<f:field bean="person" property="gender" widget-optionValue="name"/>
+<f:field bean="person" property="name">
+ <g:textField name="${property}" value="${value}"/>
+</f:field>
+Since version 1.5 you can specify which specific templates are going to be used on the view. +You can accomplish this using new attributes: wrapper, widget and templates. (See attributes section)
Since version 2.1.4 you can specify the theme to be used.
+<f:field bean="person" property="name" theme="bs-horizontal"/>+
// renders _fields/bootstrap3/_wrapper.gsp:
+<f:field bean="person" property="name" wrapper="bootstrap3"/>
+
+// renders _fields/maskedInput/_widget.gsp:
+<f:field bean="person" property="name" widget="maskedInput"/>
+
+// renders _fields/maskedInput/_wrapper.gsp and _fields/maskedInput/_widget.gsp:
+<f:field bean="person" property="name" templates="maskedInput"/>
The f:field
and f:widget
tags will pass the following parameters to your templates or to the body of f:field
if you use one:
See Customizing Field Rendering for details of the parameters passed to the tag body.
+The f:field
tag handles embedded domain properties in a special way. See Embedded Properties for details.
Name | -Type | +Required | Description | ||
---|---|---|---|---|---|
bean |
-Object |
-The |
-|||
property |
-String |
-The |
+
|
+yes for |
+The bean whose property is being rendered. This can be the object itself or the name of a page-scope variable. |
type |
-Class |
-The property type. |
+
|
+yes |
+The path to the property. This can include any level of nesting and numeric or string indexes. For example |
label |
-String |
-The field label text. This is based on the |
+
|
+No |
+Overrides the actual value of the property. |
value |
-Object |
-the property value. This can also be overridden or defaulted if the |
+
|
+No |
+A default value for the property that will be used if the actual property value is |
constraints |
-ConstrainedProperty |
-The constraints for the property if the bean is a domain or command object. |
+
|
+No |
+Overrides the required status of the property. By default this is worked out based on the property’s constraints. |
persistentProperty |
-- | The persistent property object if the bean is a domain object. |
+
|
+No |
+Overrides the validity of the property. By default this is worked out using the bean’s errors property for domain and command objects. |
errors |
-List<String> |
-The error messages for any field errors present on the property. If there are no errors this will be an empty List. |
+
|
+No |
+Overrides the field label passed to the template. This value may either be an i18n key or a literal string. |
required |
-boolean |
-
|
+
|
+No |
+A string (including the trailing period) that should be appended before the input name such as |
invalid |
-boolean |
-
|
+
|
+No |
+Specifies the name of the folder inside |
prefix |
-String |
-A string (including the trailing period) that should be appended before the input name such as |
+
|
+No |
+Specifies the name of the folder inside |
In addition f:field
passes the following parameters:
Name |
-Type |
-Description |
+
|
+No |
+Specifies the name of the folder inside |
widget |
+
|
String |
-The output of |
+Theme to use if available. |
- - | -
-If the bean attribute was not supplied to f:field then bean , type , value and persistentProperty will all be null .
- |
-
If the label
attribute is not supplied to the f:field
tag then the label string passed to the field template is resolved by convention. The plugin uses the following order of preference for the label:
An i18n message using the key beanClass.path`.label`. For example when using <f:field bean="personInstance" property="address.city"/>
the plugin will try the i18n key person.address.city.label
. If the property path contains any index it is removed so <f:field bean="authorInstance" property="books<<0>>.title"/>
would use the key author.books.title.label
.
An i18n message using the key objectType.propertyName`.label`. For example when using <f:field bean="personInstance" property="address.city"/>
the plugin will try the i18n key address.city.label
.
The natural property name. For example when using <f:field bean="personInstance" property="dateOfBirth"/>
the plugin will use the label "Date Of Birth"
.
Any additional attributes are passed to the rendered template. Any additional attributes prefixed with widget-
are instead passed to the widget template or rendered on the default input.
_wrapper.gsp
Rather than relying on the convention described previously to locate the template(s) to be used for a particular field, it is -instead possible to directly specify the directory containing the templates. This feature was introduced in version 1.5.
-The wrapper
attribute can be used with the f:field or f:display tags to specify the directory containing the _wrapper.gsp
or _displayWrapper.gsp
template to be used
The widget
attribute can be used with the f:field or f:display tags to specify the directory containing the _widget.gsp
or _displayWidget.gsp
template to be used
If the wrapper and widget templates both have the same value, the templates
attribute can be used instead as a shorthand. For example:
If you want to override a f:wrapper
to be used for all widgets then create a file with content like this:
<f:field property="startDate" templates="bootstrap3" />
-<div class="form-group ${invalid ? 'has-error' : ''}"> + <label for="${property}">${label} ${required ? '*' : ''}</label> + + <div> + <f:widget property="${property}"/> + <g:if test="${errors}"> + <g:each in="${errors}" var="error"> + <span class="help-block"><g:message error="${error}"/></span> + </g:each> + </g:if> + </div> +</div>+
is equivalent to:
<f:field property="startDate" wrapper="bootstrap3" widget="bootstrap3" />
if theme is specified, theme will be searched first to find the templates -For example
+Use f:widget tag instead
<f:field property="startDate" templates="custom" theme="bs-horizontal"/>
Will search the templates first in \_fields/_themes/bs-horizontal/custom and then \_fields/custom
+If a direct location is specified, and the templates cannot be found therein, the plugin will fall back to locating templates -by convention.
+<f:table/>
renders some or all properties of a collection of beans in a table using the f:display widget for each property type. If there is no \_display template in scope the tag will simply render the property values.
// renders _fields/\_themes/bs-horizontal/custom/_wrapper.gsp:
-<f:field property="startDate" wrapper="custom" theme="bs-horizontal"/>
-
-// renders _fields/bootstrap3/_wrapper.gsp:
-<f:field property="startDate" wrapper="bootstrap3"/>
-
-// renders _fields/time/_widget.gsp:
-<f:field property="startDate" widget="time"/>
+<f:table collection="personList"/>
-// renders _fields/time/_wrapper.gsp and _fields/time/_widget.gsp:
-<f:field property="startDate" templates="time"/>
+<f:table collection="personList" properties="firstName, lastName"/>
-// renders _fields/\_themes/bs-horizontal/custom/_displayWrapper.gsp:
-<f:display property="startDate" wrapper="custom" theme="bs-horizontal"/>
+<f:table collection="personList" properties="['firstName', 'lastName']"/>
+<f:table collection="catsAndDogsList" domainClass="org.zoo.Animal"/>
-// renders _fields/bootstrap3/_displayWrapper.gsp:
-<f:display property="startDate" wrapper="bootstrap3"/>
+<f:table collection="catsAndDogsList" domainClass="org.zoo.Animal" theme="bs-horizontal"/>
-// renders _fields/time/_displayWidget.gsp:
-<f:display property="startDate" widget="time"/>
+// List first three properties in Person
+<f:table collection="personList" maxProperties="3"/>
-// renders _fields/time/_displayWrapper.gsp and _fields/time/_displayWidget.gsp:
-<f:display property="startDate" templates="time"/>
-
Embedded properties are handled in a special way by the f:field
and f:all
tags. If the property
attribute you pass to f:field
is an embedded property then the tag recursively renders each individual property of the embedded class with a surrounding fieldset
. For example if you have a Person
class with a name
property and an Address
embedded class with street
, city
and country
properties <f:field bean="person" property="address">
will effectively do this:
The template for <f:table/>
should be in
<fieldset class="embedded address">
- <legend>Address</legend>
- <f:field bean="person" property="address.street"/>
- <f:field bean="person" property="address.city"/>
- <f:field bean="person" property="address.country"/>
-</fieldset>
-grails-app/views/templates/_fields/_table.gsp
You can customize how embedded properties are surrounded by providing a layout at grails-app/views/layouts/_fields/embedded.gsp
which will override the default layout provided by the plugin.
When you use the f:all
tag it will automatically handle embedded properties in this way.
but you can have multiple table templated, if you specify the template property.
+All templates should still be located in view/templates/_fields/
, the example below uses 4 different templates for table.
Since version 2.1.4 It is possible to create themes to provide set of templates for different css frameworks or form layouts. -For example, a bootstrap-fields plugin can provide different themes (eg bs-horizontal, bs-vertical) to support horizontal and vertical form layouts. And another plugin can provide theme for purecss framework.
+<f:table collection="myList" myProperty="Template: view/templates/_fields/_table.gsp" />
+<f:table collection="${demoList}" template="table3" myProperty="Template: view/templates/_fields/_table3.gsp" />
+<f:table collection="${demoList}" template="tables/table2" myProperty="Template: in view/templates/_fields/tables/_table2.gsp" />
+<f:table collection="${demoList}" template="tables/table" myProperty="Template: view/templates/_fields/tables/_table.gsp" />
Themes are put under directory _fields/themes/*themeName*/
.
All of the field tags supports theme attribute which accepts the name of the theme. When a theme name is specified, widget, wrapper, and display templates will be searched in theme directory first as described in Customizing Field Rendering.
-When theme is specified, the \_display template will be searched first in theme, but the theme property does not directly apply to table.
Plugins can include field and/or input level templates to support special UI rendering or non-standard property types. Just include the templates in the plugin’s grails-app/views
directory as described in the Customizing Field Rendering section.
- - | -
-If you supply templates in a plugin you should consider declaring a <%@page defaultCodec="html" %> directive so that any HTML unsafe property values are escaped properly regardless of the default codec used by client apps.
- |
+Name | +Required? | +Default | +Description |
---|---|---|---|---|---|
collection |
+yes |
++ | The collection of beans to be displayed |
+||
domainClass |
++ |
|
+The FQN of the domain class of the elements in the collection. |
+||
properties |
++ | First 7 (or less) |
+Comma-separated |
+||
displayStyle |
++ | + | Determines the display template used for the bean’s properties. Defaults to table meaning that \_display-table templates will be used when available. |
+||
except |
++ |
|
+A comma-separated |
+||
order |
++ | + | Comma-separated |
+||
theme |
+String |
++ | Theme to use if available. |
+||
maxProperties |
+Number |
+7 |
+The maximum number of properties to display when rendering the table. If zero is specified all columns are shown, otherwise |
+||
template |
+String |
+table |
+Alternative template for table rendering. Templates should be in the grails-app/views/templates/_fields/ folder. |
+
In order to be performant, the Fields plugin caches field template lookup results by default. This makes it possible to perform the time-consuming template path resolutions only once during the runtime of the application.
-When template caching is active, only the first page renderings are slow, subsequent ones are fast.
-Due to the flexibility needed during template development, this feature can be disabled so it would be possible to recognize newly added field templates without restarting the application. As a result, with bigger webpages, containing a lot of fields, rendering may be fairly slow in development (depending on the number of fields on the page).
-For template development, the following configuration attribute should be placed in the development environment section of your application’s Config.groovy:
-grails.plugin.fields.disableLookupCache = true
-or
+Any additional attributes are passed to the rendered template.
environments:
- development:
- grails:
- plugin:
- fields:
- disableLookupCache: true
_table.gsp
template.After the template development has finished, it is recommended to re-enable the template lookup cache in order to have a performant page rendering even during development.
-To make you own version of a f:table
template, the file should be located in grails-app/views/templates/_fields/_table.gsp
+unless a different location is specified with the template property.
+You can find a starting point for a new file on GitHub
Renders fields for all properties of an object by using f:field
for each property.
The following model is passed to the _table.gsp
template:
Name | +Content | +
---|---|
domainClass |
+The type of the persistent instance. Either type of the first row in the collection or the |
+
columnProperties |
+Contains a list of |
+
domainProperties |
+deprecated: see |
+
collection |
+Rows with data |
+
displayStyle |
+The attribute |
+
theme |
+The attribute |
+
The id
, version
, dateCreated
and lastUpdated
properties are skipped on domain classes. Additionally any property with a display: false
constraint set will be skipped.
The column model:
Name | -Required | -Description | +Content | |
---|---|---|---|---|
bean |
-if not inside |
-The bean whose property is being rendered. This can be the object itself or the name of a page-scope variable. |
+
|
+Empty instance of a |
except |
-N/A |
-A comma-separated list of properties that should be skipped (in addition to the defaults). |
+
|
+The property name |
order |
-N/A |
-A comma-separated list of properties which represents the order in which the tag should generate fields. |
+
|
+Deprecated, see |
prefix |
-String |
-A string (including the trailing period) that should be appended before the input name such as |
+
|
+The property type |
theme |
-String |
-Theme to use if available. |
+
|
+Translated label (deprecated) |
+
|
+Translated label |
+|||
|
+If the property has constraints |
+|||
|
+Is the property required |
You can pass extra attributes to the all tag that will be propagated to the inner fields.
+(This is a simplified version of a wrapper
model)
<f:all bean="person" wrapper="someWrapper"/>
In that way all the fields are going to be executed as if they were executed with the extra attribute on them.
+f:widget
renders an appropriate widget for a property, for example an <input type="text">
element for a String
property or a <select>
for an enum.
-Remember that if you want to use some of those attributes in the widget templates you need to prefix them with the widget- word (unless you have configured another prefix)
+Using f:widget directly will only be necessary for very specialized cases, usually it will be invoked via f:field .
|
f:widget
accepts exactly the same attributes as the f:field tag (except for wrapper
and templates
attributes).
f:display
renders a property for display. If there is no _displayWrapper
template in scope the tag will simply render the property value.
The <f:widget/>
tag will will by default use sensible defaults when rendering String
, Number
, Boolean
, URL
, Enum
, Date
and associations like oneToOne
, oneToMany
, manyToOne
and manyToMany
.
f:display
template will look for a _displayWrapper
for the wrapper itself and a _displayWidget
for the widget used inside the wrapper template.
In a few cases it is possible to control which default widget to use, by specifying it in the beans constraints
.
If the f:display
tag has a body its output is used as the value passed as the value
model to the _display
template. If there is no body then the raw property value is passed to g:fieldValue
, g:formatDate
or g:formatBoolean
depending on its type and the result is passed as the value
model to the _display
template.
- - | --In version 1.5 new attributes were added: -Since then you can specify the folders where the templates are located. You can do this for the wrapper folder, the widget folder ot both (if they are located on the same folder). - | -
<f:display bean="person"/>
-
-<f:display bean="person" displayStyle="table"/>
-
-<f:display bean="person" property="name"/>
-
-// renders widget and wrapper from subdirectory of _fields/_themes/purecss if defined
-<f:display bean="person" property="name" theme="purecss"/>
-
-// renders _fields/bootstrap3/_displayWrapper.gsp:
-<f:display bean="person" property="name" wrapper="bootstrap3"/>
-
-// renders _fields/maskedInput/_displayWidget.gsp:
-<f:display bean="person" property="name" widget="maskedInput"/>
-
-// renders _fields/maskedInput/_displayWrapper.gsp and _fields/maskedInput/_displayWidget.gsp:
-<f:display bean="person" property="name" templates="maskedInput"/>
-
-<f:display bean="person" property="dateOfBirth">
- <g:formatDate format="dd MMM yyyy" date="${value}"/>
-</f:display>
-The following happens with these types:
By default, properties instance of String
renders a <g:field type="text">
type field, but the constraints
in the bean will alter this in these cases:
Name | -Required | -Description | -||
---|---|---|---|---|
bean |
-if not inside |
-The bean whose property is being rendered. This can be the object itself or the name of a page-scope variable. |
-||
property |
-No |
-The path to the property. This can include any level of nesting and numeric or string indexes. For example |
-||
value |
-No |
-Overrides the actual value of the property. |
+
|
+Rendered Widget type |
default |
-No |
-A default value for the property that will be used if the actual property value is |
+
|
+
|
label |
-No |
-Overrides the field label passed to the template. This value may either be an i18n key or a literal string. |
+
|
+
|
displayStyle |
-No |
-When specified and different from the string |
+
|
+
|
except |
-No |
-A comma-separated list of properties that should be skipped. |
+
|
+
|
order |
-No |
-A comma-separated list of properties which represents the order in which the tag should display them. |
+
|
+
|
By default, properties instance of Number
renders a <g:field type="number">
or <:field type="number decimal"/>
type field, but the constraints
in the bean will alter this in these cases:
theme |
-No |
-Theme to use if available. The theme can define a new directory structure in /_fields/_themes/<themename> which will take priority over templates, wrapper and widget if they are specified, as it is injecting the search path first in the list. |
+
|
+Affects the rendered widget |
templates |
-No |
-Specify the folder inside _fields where to look up for the wrapper and widget template. |
+
|
+Sets the |
widget |
-No |
-Specify the folder inside _fields where to look up for the widget template. |
+
|
+Set the |
wrapper |
-No |
-Specify the folder inside _fields where to look up for the wrapper template. |
+
|
+Set the |
Any additional attributes are passed to the rendered template.
+By default, the value is formatted with the default numberFormatter
based on the request locale.
This behavior can be turned off in the configuration by setting:
grails:
+ plugin:
+ fields:
+ localizeNumbers: false
When f:display
is used without a property
then all bean properties are rendered. This is done with the grails-app/views/templates/_fields/_list.gsp
template. The default template can be found on GitHub
f:displayWidget
renders an appropriate widget for a display property, for example an <span>${value}</span>
element for a String
property.
- - | -
-Using f:displayWidget directly will only be necessary for very specialized cases, usually it will be invoked via f:display .
- |
-
Renders a <g:checkBox/>
f:displayWidget
accepts exactly the same attributes as the f:display tag (except for wrapper
and templates
attributes).
Renders a <g:field type="url"/>
_displayWidget.gsp
If you have a domain class with a java.time.LocalDate
you might want to format it specially:
enum
types always renders a <g:select/>
with all the values in the type. To render a subset of enum
values, the inList
constraint can be used.
<%@ page import="java.time.format.DateTimeFormatter" %> -<g:set var="localDatePattern" value="${message(code: 'default.localDate.format',default: 'yyyy-MM-dd')}"/> -${value?.format(DateTimeFormatter.ofPattern(localDatePattern, request.getLocale()))}
Renders a <g:datePicker/>
. If Date
, Calendar
, or java.sql.Date
then precision
is set to day
, if java.sql.Time
then minute
Renders a <g:field type="file"/>
oneToOne
, manyToOne
or manyToMany
associationsf:field
renders the widget using either f:widget
or the tag body accompanied by any surrounding markup, typically a container, a label
tag and any validation messages.
All these associations renders a <g:select/>
and if association has a nullable: true
constraint, then a noSelection
attribute is added.
By default the f:field
tag will output:
For the manyToMany
association, the multiple
attribute is set.
<div class="fieldcontain">
- <label for="foo">Foo</label>
- <!-- the widget as generated by f:widget or the tag body -->
-</div>
+oneToOne and `manyToOne
renders a
The intention is that f:field
should typically be used without
a tag body. For example:
<f:field bean="person" property="name"/>
+The oneToMany
association does not render an input type field, but does instead render a list of links to the associated objects.
_widget.gsp
In which case the tag will use f:widget
to generate an appropriate input. Alternatively in more specialized cases you can give f:field
a tag body. For example:
If you want to override a f:widget
for a String
, then create a file with content like this:
<f:field bean="person" property="name">
- <g:textField name="${property}" value="${value}"/>
-</f:field>
+<g:textField name="${property}" value="${value}" required="${required}" class="form-control"/>
Since version 1.5 you can specify which specific templates are going to be used on the view. -You can accomplish this using new attributes: wrapper, widget and templates. (See attributes section)
Since version 2.1.4 you can specify the theme to be used.
<f:field bean="person" property="name" theme="bs-horizontal"/>+
Places a bean in scope so that the bean attribute can be omitted on contained tags.
// renders _fields/bootstrap3/_wrapper.gsp:
-<f:field bean="person" property="name" wrapper="bootstrap3"/>
-
-// renders _fields/maskedInput/_widget.gsp:
-<f:field bean="person" property="name" widget="maskedInput"/>
-
-// renders _fields/maskedInput/_wrapper.gsp and _fields/maskedInput/_widget.gsp:
-<f:field bean="person" property="name" templates="maskedInput"/>
-See Customizing Field Rendering for details of the parameters passed to the tag body.
+<f:with bean="person">
+ <f:field property="name"/>
+ <f:field property="address.city"/>
+</f:with>
The f:field
tag handles embedded domain properties in a special way. See Embedded Properties for details.
Name | -Required | -Description | +Name | +Required? | +Description |
---|---|---|---|---|---|
|
-yes for |
-The bean whose property is being rendered. This can be the object itself or the name of a page-scope variable. |
-|||
|
+bean |
yes |
-The path to the property. This can include any level of nesting and numeric or string indexes. For example |
-||
|
-No |
-Overrides the actual value of the property. |
-|||
|
-No |
-A default value for the property that will be used if the actual property value is |
-|||
|
-No |
-Overrides the required status of the property. By default this is worked out based on the property’s constraints. |
-|||
|
-No |
-Overrides the validity of the property. By default this is worked out using the bean’s errors property for domain and command objects. |
-|||
|
-No |
-Overrides the field label passed to the template. This value may either be an i18n key or a literal string. |
-|||
|
-No |
-A string (including the trailing period) that should be appended before the input name such as |
-|||
|
-No |
-Specifies the name of the folder inside |
-|||
|
-No |
-Specifies the name of the folder inside |
-|||
|
-No |
-Specifies the name of the folder inside |
+The bean whose property is being rendered. This can be the object itself or the name of a page-scope variable. |
||
|
+prefix |
String |
-Theme to use if available. |
+A string (including the trailing period) that should be appended before the input name such as |
Any additional attributes are passed to the rendered template. Any additional attributes prefixed with widget-
are instead passed to the widget template or rendered on the default input.
You can pass any number of extra attributes to the with tag that will be propagated to the inner fields and displays.
+<f:with bean="person" wrapper="someWrapper">
+ <f:field property="name"/>
+ <f:field property="address.city"/>
+</f:with>
_wrapper.gsp
If you want to override a f:wrapper
to be used for all widgets then create a file with content like this:
That way you don’t need to repeat the same attribute over and over. +The code above is the same as:
<div class="form-group ${invalid ? 'has-error' : ''}"> - <label for="${property}">${label} ${required ? '*' : ''}</label> - - <div> - <f:widget property="${property}"/> - <g:if test="${errors}"> - <g:each in="${errors}" var="error"> - <span class="help-block"><g:message error="${error}"/></span> - </g:each> - </g:if> - </div> -</div>+
<f:with bean="person">
+ <f:field property="name" wrapper="someWrapper"/>
+ <f:field property="address.city" wrapper="someWrapper"/>
+</f:with>
You can override the extra attributes on any field just changing the attribute value on the popper field or display
+<f:with bean="person" wrapper="someWrapper">
+ <f:field property="name"/>
+ <f:field property="address.city"/>
+ <f:field property="address.zip" wrapper="differentWrapper"/>
+</f:with>
++ + | ++Remember that if you want to use some of those attributes in the widget or displayWidget templates you need to prefix them with the widget- word (unless you have configured another prefix) + | +
Use f:widget tag instead
<f:table/>
renders some or all properties of a collection of beans in a table using the f:display widget for each property type. If there is no \_display template in scope the tag will simply render the property values.
In your build.gradle
file, use:
<f:table collection="personList"/>
-
-<f:table collection="personList" properties="firstName, lastName"/>
-
-<f:table collection="personList" properties="['firstName', 'lastName']"/>
-
-<f:table collection="catsAndDogsList" domainClass="org.zoo.Animal"/>
-
-<f:table collection="catsAndDogsList" domainClass="org.zoo.Animal" theme="bs-horizontal"/>
-
-// List first three properties in Person
-<f:table collection="personList" maxProperties="3"/>
-
-// Include id, lastUpdated, dateCreated
-<f:table collection="personList" except="[]]"/>
+implementation 'io.github.gpc:fields:5.0.0'
The template for <f:table/>
should be in
Changelog: +https://github.com/gpc/fields/compare/v4.0.0...v5.0.0
grails-app/views/templates/_fields/_table.gsp
Important
but you can have multiple table templated, if you specify the template property.
-All templates should still be located in view/templates/_fields/
, the example below uses 4 different templates for table.
New group
id.
In your build.gradle
file, use:
<f:table collection="myList" myProperty="Template: view/templates/_fields/_table.gsp" />
-<f:table collection="${demoList}" template="table3" myProperty="Template: view/templates/_fields/_table3.gsp" />
-<f:table collection="${demoList}" template="tables/table2" myProperty="Template: in view/templates/_fields/tables/_table2.gsp" />
-<f:table collection="${demoList}" template="tables/table" myProperty="Template: view/templates/_fields/tables/_table.gsp" />
+compile 'io.github.gpc:fields:4.0.0'
When theme is specified, the \_display template will be searched first in theme, but the theme property does not directly apply to table.
-Name | -Required? | -Default | -Description | -
---|---|---|---|
collection |
-yes |
-- | The collection of beans to be displayed |
-
domainClass |
-- |
|
-The FQN of the domain class of the elements in the collection. |
-
properties |
-- | First 7 (or less) |
-Comma-separated |
-
displayStyle |
-- | - | Determines the display template used for the bean’s properties. Defaults to table meaning that \_display-table templates will be used when available. |
-
except |
-- |
|
-A comma-separated |
-
order |
-- | - | Comma-separated |
-
theme |
-String |
-- | Theme to use if available. |
-
maxProperties |
-Number |
-7 |
-The maximum number of properties to display when rendering the table. If zero is specified all columns are shown, otherwise |
-
template |
-String |
-table |
-Alternative template for table rendering. Templates should be in the grails-app/views/templates/_fields/ folder. |
-
Any additional attributes are passed to the rendered template.+
Changelog: +https://github.com/gpc/fields/compare/v3.0.0.RC1...v4.0.0
Thank goes to the community for all the contributions!
_table.gsp
template.To make you own version of a f:table
template, the file should be located in grails-app/views/templates/_fields/_table.gsp
-unless a different location is specified with the template property.
-You can find a starting point for a new file on GitHub
Last version that is on the "old" group org.grails.plugins
The following model is passed to the _table.gsp
template:
Changelog: +https://github.com/gpc/fields/compare/v2.2.10...v3.0.0.RC1
Name | -Content | -
---|---|
domainClass |
-The type of the persistent instance. Either type of the first row in the collection or the |
-
columnProperties |
-Contains a list of |
-
domainProperties |
-deprecated: see |
-
collection |
-Rows with data |
-
displayStyle |
-The attribute |
-
theme |
-The attribute |
-
The column model:
Name | -Content | -
---|---|
|
-Empty instance of a |
-
|
-The property name |
-
|
-Deprecated, see |
-
|
-The property type |
-
|
-Translated label (deprecated) |
-
|
-Translated label |
-
|
-If the property has constraints |
-
|
-Is the property required |
-
(This is a simplified version of a wrapper
model)
Changelog: +https://github.com/grails-fields-plugin/grails-fields/compare/v2.2.8...v2.2.9
+BugFix: Table Tag does not render transient fields correctly (Issue #264)
+BugFix: Table Tag does not render references correctly! +(Issue #269)
+BugFix: Fix XSS vulnerability when rendering beans (Issue #278) +GitHub diff
+BugFix: The fix for #257 did not work as described, but now it does.
+Improvement: Documentation has been improved with more examples for the various tags. +GitHub diff
+f:widget
renders an appropriate widget for a property, for example an <input type="text">
element for a String
property or a <select>
for an enum.
- - | -
-Using f:widget directly will only be necessary for very specialized cases, usually it will be invoked via f:field .
- |
-
Improvement: Introduced maxProperties
attribute to <f:table/>
Improvement: Render value that is an association but not to a grom entity
+Improvement: Rendering numbers is now Locale-aware (can be configured)
+f:widget
accepts exactly the same attributes as the f:field tag (except for wrapper
and templates
attributes).
The <f:widget/>
tag will will by default use sensible defaults when rendering String
, Number
, Boolean
, URL
, Enum
, Date
and associations like oneToOne
, oneToMany
, manyToOne
and manyToMany
.
Bug-fix: Another issue with old API
+In a few cases it is possible to control which default widget to use, by specifying it in the beans constraints
.
The following happens with these types:
Bug-fix: Fix issue with oneToMany expecting the old API
+By default, properties instance of String
renders a <g:field type="text">
type field, but the constraints
in the bean will alter this in these cases:
|
-Rendered Widget type |
-
|
-
|
-
|
-
|
-
|
-
|
-
|
-
|
-
|
-
|
-
By default, properties instance of Number
renders a <g:field type="number">
or <:field type="number decimal"/>
type field, but the constraints
in the bean will alter this in these cases:
Bug-fix: Autowire beans
+
|
-Affects the rendered widget |
-
|
-Sets the |
-
|
-Set the |
-
|
-Set the |
-
By default, the value is formatted with the default numberFormatter
based on the request locale.
This behavior can be turned off in the configuration by setting:
grails:
- plugin:
- fields:
- localizeNumbers: false
+Conversion to the Mapping Context API. +Usages of the GrailsDomainClass and GrailsDomainClassProperty classes have been removed. +If you extend a template that relies on those classes, they have been replaced with PersistentEntity and DomainProperty respectively.
+Conversion of constraints to a common implementation between grails.validation and grails.gorm.validation. +See Constrained.
+Upgrade to Grails 3.2.8
+Convert documentation to Asciidoc
+Add support for themes
+Renders a <g:checkBox/>
Renders a <g:field type="url"/>
Redesign for Grails 3.0
+enum
types always renders a <g:select/>
with all the values in the type. To render a subset of enum
values, the inList
constraint can be used.
2015_04_26
Renders a <g:datePicker/>
. If Date
, Calendar
, or java.sql.Date
then precision
is set to day
, if java.sql.Time
then minute
See Browse issues
++ + | ++See Usage and Customizing Field Rendering for breaking changes. + | +
Renders a <g:field type="file"/>
Upgraded plugin to work with Grails 2.3.x (Issue #122)
+Fixed missing property exception (Issue #134)
+Fixed encoding in tag libraries (Issue #137)
+Configuring caching in dev mode (Issue #139)
+byte[] and Byte[] arrays types now look for files in byteArray folders (general for all array types) (Issue #144)
+oneToOne
, manyToOne
or manyToMany
associationsAll these associations renders a <g:select/>
and if association has a nullable: true
constraint, then a noSelection
attribute is added.
For the manyToMany
association, the multiple
attribute is set.
oneToOne and `manyToOne
renders a
2012-07-31
Adds the f:display tag.
+Supports overriding templates by property type or by default in individual controllers and actions.
+The oneToMany
association does not render an input type field, but does instead render a list of links to the associated objects.
Browse issues +Thanks to https://github.com/cdeszaq,[Rick Jensen] https://github.com/delight,[Konstantinos Kostarellis] Gus Power and Eliot Sykes for their contributions.
_widget.gsp
If you want to override a f:widget
for a String
, then create a file with content like this:
2012-03-16
<g:textField name="${property}" value="${value}" required="${required}" class="form-control"/>+
Pass attributes from f:field
to the rendered input using input-
prefix.
Optionally use entire property path for label key.
+Browse issues +Thanks to Brian Saville and OverZealous for contributions.
2012-03-11
Adds the prefix attribute.
+Support widget:'textarea'
constraint.
Places a bean in scope so that the bean attribute can be omitted on contained tags.
-Browse issues +Thanks to Brian Saville for contributions.
<f:with bean="person">
- <f:field property="name"/>
- <f:field property="address.city"/>
-</f:with>
2012-02-13: Bugfix release.
Name | -Required? | -Description | -
---|---|---|
bean |
-yes |
-The bean whose property is being rendered. This can be the object itself or the name of a page-scope variable. |
-
prefix |
-String |
-A string (including the trailing period) that should be appended before the input name such as |
-
You can pass any number of extra attributes to the with tag that will be propagated to the inner fields and displays.
+2012-02-09: Bugfix release.
<f:with bean="person" wrapper="someWrapper">
- <f:field property="name"/>
- <f:field property="address.city"/>
-</f:with>
+
That way you don’t need to repeat the same attribute over and over. -The code above is the same as:
-<f:with bean="person">
- <f:field property="name" wrapper="someWrapper"/>
- <f:field property="address.city" wrapper="someWrapper"/>
-</f:with>
+2012-02-07: Bugfix release.
You can override the extra attributes on any field just changing the attribute value on the popper field or display
-<f:with bean="person" wrapper="someWrapper">
- <f:field property="name"/>
- <f:field property="address.city"/>
- <f:field property="address.zip" wrapper="differentWrapper"/>
-</f:with>
+2012-02-03: Bugfix release.
- - | --Remember that if you want to use some of those attributes in the widget or displayWidget templates you need to prefix them with the widget- word (unless you have configured another prefix) - | -