Page History
Table of Contents |
---|
Introduction
Magnolia 5.1 introduce a new way to handle properties bound to a dialog field. Until Magnolia 5.1 the only way to modify the default behavior (a field is bound to a simple property) was to override the FieldBuilder.getOrCreateProperty(..
method.
Now by configuration we have the possibility to define custom way to initialize a property and link it to a field. This is us full for complex fields like MultiField
CompositeField
that needs more than one property bound to them.
Basic Concept
A Field
is linked to a Property
used to store the field value. This Property
is set by the FieldBuilder
based on the passed Item
.
For example a TextField
named 'text' has a Property
bound to the Item
Property
'text'.
Now for a MultiField,
the related Property
can no more be a simple Property
but rather a ListProperty
. This ListProperty
will be populated with the individual field Property
values.
This is the first information needed in order to handle complex fields: The PropertType
(Basic, List, Composite,...)
The way values of the ListProperty
is set and retrieve from the related Item
is also something we would like to configure. For example I may want to have a MultiField
composed of DateField
stored in a single multi value.
The same field may be used in another place but the values have to be stored as sub item (nodes) elements. PropertHandler
is the second information needed. PropertHandler
handle the way property element are retrieve and set to an Item
.
Configuration
Default behavior
...