Page History
...
Advanced Tables - Table Plus | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
|
...
Advanced Tables - Table Plus | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||
|
...
Advanced Tables - Table Plus | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
|
...
- return
true
forTransformer
.hasI18NSupport() - implement a compatible Magnolia i18n logic.
Default Value
The field default value is defined as String
in defaultValue
property in the ConfiguredFieldDefinition.
ConfiguredFieldDefinition.defaultValue
contains the String representation of the default value.
The default value is displayed on the field only showed the first time the related form is displayed.
This behavior is only supported by basic field .
Implemented
Property
A field needs to be linked to a property as data source. The value of the property is used to store the value entered/selected by the user on the field.
In Magnolia 5.1, every field are bound to a property that support Transformer
called TransformedProperty
.
This property is initialized with the configured Transformer
and set to the field as datasource by the FieldFactory
.
Mockup | ||
---|---|---|
|
A ConfiguredField is linked to a TransformedProperty<T>
.
...
TransformedProperty<T>
may be of any type. For a TextField defined configured to handle Long (ConfiguredFieldDefinition.type = Long
), the <T>
will be of type Long
.
For complexer Field (Multi, Composite) the <T>
is of type PropertysetItem
. This let the complex field easily handle multi property.
Implemented Handlers
BasicPropertyHandler
Overview
Mockup | ||
---|---|---|
|
BasicPropertyHandler
Implemented Transformer
BasicTransformer
The property
linked to a field is retrieved and stored based on the Field's property name
defined in the field definition.
A new property
is created in case id does not yet exist.
...
Advanced Tables - Table Plus | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||
|
OptionGroupPropertyHandler
In case of an OptionGroup
field is defined as multiselect
, the selected values are stored as a JCR multi-value-property. This JCR multi-value-property is normally handled as a List,
but the underlying Vaadin field is only working with Set
. This handler simply convert List
to Set
.
TextCodePropertyHandler
Simple TextCode Handler that return an empty String
instead of a null property
value.
TwinSelectPropertyHandler
Like for the OptionGroup
field, the underlying Vaadin Field need additional convertor between List
to Set
.
CompositeHandler
CompositeTransformer
In In addition to the CompositeField
and SwitchableField
default Handler
Transformer
, we provide two an additional CompositeHandler
Transformer
:
SubNodeCompositeHandler
SubNodeCompositeHandler
will store the property
values of the fields composing the composite field under the following format:
...
enableHeadingAttributes | false |
---|---|
enableSorting | false |
class | m5-configuration-tree |
enableHighlighting | false |
...
formNode
...
...
Second field name composing the
Composite field
...
NoOpCompositeTransformer
NoOpCompositeTransformer
...
Third field name composing the
Composite field
...
This Handler
do not support i18n
(in Magnolia 5.1).
NoOpCompositeHandler
NoOpCompositeHandler
is useful if you want to combine a Multi filed storing individual field value into sub nodes with composite field as Multi field component.
Mockup | ||
---|---|---|
|
In this case, the Multi field handler field
will createread/read write the node Item structure and pass a properties as Transformer
PropertysetItem
to the NoOpCompositeHandler
NoOpCompositeTransformer
. This handler This
just act as a property container. Transformer
MultiTransformer
MultiHandler
...
MultiValueTransformer
This is the default Handler
default
set for Multi value fields. The fields values are stored in a Transformer
. This LinkedList
<T>
is then automatically convert to a JCR multi-value-property once it is persisted. LinkedList
<T>
This will only work for simple fields like text/date/radio...
...
MultiValueJSONTransformer
Handler
storing
storing the fields values as a Transformer
String
with ',' as separator.
This will only work for simple fields like text/date/radio... and values are stored as String
.
...
MultiValueChildrenNodeTransformer
Handler
storing the fields values in sub node item property: (Equivalent Jcr Structure of the form Item)Transformer
Advanced Tables - Table Plus | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||
|
SubNodesMultiPropertysetItemHandler
MultiValueSubChildrenNodePropertiesTransformer
storing each field values into a sub Item. Equivalent to Transformer
MultiValueChildrenNodeTransformer
but this
is able to handle multiple values. Based on the previous Transformer
NoOpCompositeHandler
o previous NoOpCompositeTransformer
example:
Advanced Tables - Table Plus | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
...
MultiValueSubChildrenNodeTransformer
Handler
creating
creating first a child node (named as the multi field) and storing the fields values in sub node property (equivalent to Transformer
MultiValueChildrenNodeTransformer
) :
Advanced Tables - Table Plus | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||
|
Limitation
How to
Open Issue
Default value handling
The field definition allows to define a default value as a String:
- Text field, type is String default value is 'default value'
- Text field, type is Long default value is 1000l
- ....
This default value should be displayed in the related form field if ????
- It is a new Form
- easy to implement
- if a field is added to an existing form, this default value will never be displayed.
- chooses solution
- If the property related to a form is null (currently if a property has an empty value, this property is removed or not saved)
- easy to implement
- if a user remove the default value associated to a field --> no property saved. When he will reopen this form, the default value will be displayed again
- ??
...