Page History
...
Until Magnolia 5.1, the transformation between (2) and (3) was a 1:1 translation, meaning that the individual fields where directly accessing the Item. Now Magnolia 5.1 introduce a new layer between (2) and (3) allowing to perform complexer mapping. This layer is called Transformer.
Assume that we have a new requirement regarding our form example: The Item (2) stay the same, but the form should only display one text field containing the full name (first and last name) . This is now possible by defining a TransformerClass
property on the Field Definition:
Mockup | ||
---|---|---|
|
In this case, the field builder will create a TransformedProperty
as field property datasource. This TransformedProperty
delegate to the Transformer
the get and set value field calls.
Another good example for illustrating the Transformer
behavior is the MultiValueField.
The the related field 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,...)complex property containing several values. This property is a PropertysetItemt
(a Property
containing several Property
).
Mockup | ||||
---|---|---|---|---|
|
...